Skip to content

Commit d2f0305

Browse files
author
Nir Maoz
authored
Add eslint (#219)
1 parent 9ea48e8 commit d2f0305

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
extends: ['standard', 'standard-react'],
4+
env: {
5+
node: true,
6+
jest: true
7+
},
8+
parserOptions: {
9+
ecmaVersion: 2020,
10+
ecmaFeatures: {
11+
legacyDecorators: true,
12+
jsx: true
13+
}
14+
},
15+
settings: {
16+
react: { version: '16' }
17+
},
18+
rules: {
19+
'space-before-function-paren': 0,
20+
'react/prop-types': 0,
21+
'react/jsx-handler-names': 0,
22+
'react/jsx-fragments': 0,
23+
'react/no-unused-prop-types': 0,
24+
'import/export': 0,
25+
'no-unused-vars': 'off',
26+
semi: [1, 'always']
27+
}
28+
};

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"test:build": "TEST_ENV=PRODUCTION npm run test:unit",
1616
"test:e2e": "cd ./e2e-test && npm run test",
1717
"test:coverage": "jest --coverage",
18+
"test:lint": "eslint src --ext js,jsx",
1819
"pretest:e2e": "npm pack && cpy cloudinary-react-*.tgz e2e-test --rename=cloudinary-react.tgz",
1920
"build": "microbundle --no-compress --sourcemap false --jsx React.createElement --format esm,umd,cjs && npm run bundlewatch",
2021
"start": "microbundle watch --no-compress --sourcemap false --jsx React.createElement --format esm,umd,cjs",
@@ -35,6 +36,7 @@
3536
"devDependencies": {
3637
"@babel/cli": "^7.2.0",
3738
"@babel/core": "^7.2.2",
39+
"@babel/eslint-parser": "^7.13.4",
3840
"@babel/plugin-proposal-class-properties": "^7.8.3",
3941
"@babel/plugin-proposal-export-default-from": "^7.2.0",
4042
"@babel/preset-env": "^7.2.0",
@@ -54,6 +56,14 @@
5456
"del-cli": "^3.0.0",
5557
"enzyme": "^3.10.0",
5658
"enzyme-adapter-react-16": "^1.14.0",
59+
"eslint": "^7.20.0",
60+
"eslint-config-standard": "^14.1.0",
61+
"eslint-config-standard-react": "^9.2.0",
62+
"eslint-plugin-import": "^2.18.2",
63+
"eslint-plugin-jsx-a11y": "^6.4.1",
64+
"eslint-plugin-node": "^11.0.0",
65+
"eslint-plugin-react": "^7.17.0",
66+
"eslint-plugin-standard": "^4.0.1",
5767
"jest": "^26.6.3",
5868
"jest-environment-enzyme": "^7.1.2",
5969
"jest-enzyme": "^7.1.2",

0 commit comments

Comments
 (0)