Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: moved to compatible with React 17 #48

Merged
merged 3 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .babelrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/**
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"extends": "eslint-config-airbnb",
"env": {
"browser": true,
"mocha": true,
"jest": true,
"node": true
},
"parser": "babel-eslint",
"rules": {
"no-restricted-globals": [1, "isFinite"],
"valid-jsdoc": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: node_js
node_js:
- "8.5.0"
- "14"
services:
- xvfb
before_script:
- export DISPLAY=:99.0
script:
- ./node_modules/karma/bin/karma start test/karma.conf.js --browsers Firefox --single-run --no-auto-watch --capture-timeout 60000
- npm run test
- npm run lint
29 changes: 29 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const BABEL_ENV = process.env.BABEL_ENV;

const plugins = [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-export-namespace-from',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-object-rest-spread',
];

if (BABEL_ENV === 'umd') {
plugins.push('@babel/plugin-external-helpers');
}

// eslint-disable-next-line no-nested-ternary
const babelModules = BABEL_ENV === 'commonjs' ? 'commonjs' : BABEL_ENV === 'test' ? 'auto' : false;

module.exports = {
plugins,
presets: [
['@babel/preset-env', {
modules: babelModules,
targets: {
browsers: ['last 2 versions'],
},
}],
'@babel/preset-react',
],
};
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
clearMocks: true,
testEnvironment: 'jsdom',
verbose: true,
};
Loading