mirror of
https://github.com/status-im/realm-js.git
synced 2025-02-02 01:36:12 +00:00
Properly configure ESLint for syntax checking
Added a test case to run on CI as well.
This commit is contained in:
parent
7fe4a65332
commit
27073a9e66
7
.eslintignore
Normal file
7
.eslintignore
Normal file
@ -0,0 +1,7 @@
|
||||
/core*/
|
||||
/docs/jsdoc-template/
|
||||
/docs/output/
|
||||
|
||||
build/
|
||||
node_modules/
|
||||
vendor/
|
@ -3,6 +3,7 @@
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"comma-dangle": 0,
|
||||
"no-empty": 0,
|
||||
"no-unused-vars": 1,
|
||||
"strict": [2, "global"]
|
||||
}
|
11
docs/.eslintrc.json
Normal file
11
docs/.eslintrc.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"ecmaFeatures": {
|
||||
"impliedStrict": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-unused-vars": 0
|
||||
}
|
||||
}
|
@ -3,9 +3,6 @@
|
||||
"commonjs": true,
|
||||
"es6": true
|
||||
},
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"globals": {
|
||||
"cancelAnimationFrame": false,
|
||||
"clearImmediate": false,
|
||||
@ -19,14 +16,22 @@
|
||||
"setTimeout": false
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"forOf": false,
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"strict": 0,
|
||||
"react/jsx-no-duplicate-props": 2,
|
||||
"react/jsx-no-undef": 2,
|
||||
"react/jsx-uses-react": 2,
|
||||
"react/jsx-uses-vars": 2,
|
||||
"react/no-direct-mutation-state": 1,
|
||||
"react/prefer-es6-class": 1,
|
||||
"react/react-in-jsx-scope": 2
|
1
examples/ReactNativeBenchmarks/.eslintrc.json
Symbolic link
1
examples/ReactNativeBenchmarks/.eslintrc.json
Symbolic link
@ -0,0 +1 @@
|
||||
../ReactExample/.eslintrc.json
|
@ -42,10 +42,14 @@
|
||||
"get-version": "echo $npm_package_version",
|
||||
"set-version": "scripts/set-version.sh",
|
||||
"jsdoc": "rm -rf docs/output && jsdoc -c docs/conf.json",
|
||||
"lint": "eslint",
|
||||
"test": "scripts/test.sh",
|
||||
"prepublish": "scripts/prepublish.sh"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^5.0.0",
|
||||
"eslint": "^2.2.0",
|
||||
"eslint-plugin-react": "^4.1.0",
|
||||
"jsdoc": "^3.4.0"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -3,17 +3,22 @@
|
||||
"commonjs": true,
|
||||
"es6": true
|
||||
},
|
||||
"ecmaFeatures": {
|
||||
"forOf": false,
|
||||
"jsx": true
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"forOf": false,
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"rules": {
|
||||
"strict": 0,
|
||||
"react/jsx-no-duplicate-props": 2,
|
||||
"react/jsx-no-undef": 2,
|
||||
"react/jsx-uses-react": 2,
|
||||
"react/jsx-uses-vars": 2,
|
||||
"react/no-direct-mutation-state": 1,
|
||||
"react/prefer-es6-class": 1,
|
||||
"react/react-in-jsx-scope": 2
|
@ -75,6 +75,9 @@ if [ -s "${HOME}/.nvm/nvm.sh" ]; then
|
||||
fi
|
||||
|
||||
case "$TARGET" in
|
||||
"eslint")
|
||||
npm run lint .
|
||||
;;
|
||||
"jsdoc")
|
||||
npm run jsdoc
|
||||
;;
|
||||
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"commonjs": true
|
||||
},
|
||||
"ecmaFeatures": {
|
||||
"forOf": true
|
||||
},
|
||||
"rules": {
|
||||
"no-empty": 0,
|
||||
"no-unused-vars": 0
|
||||
}
|
||||
}
|
21
tests/js/.eslintrc.json
Normal file
21
tests/js/.eslintrc.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"env": {
|
||||
"commonjs": true
|
||||
},
|
||||
"globals": {
|
||||
"ArrayBuffer": false,
|
||||
"DataView": false,
|
||||
"Float32Array": false,
|
||||
"Float64Array": false,
|
||||
"Int16Array": false,
|
||||
"Int32Array": false,
|
||||
"Int8Array": false,
|
||||
"Uint16Array": false,
|
||||
"Uint32Array": false,
|
||||
"Uint8Array": false,
|
||||
"Uint8ClampedArray": false
|
||||
},
|
||||
"rules": {
|
||||
"no-redeclare": 1
|
||||
}
|
||||
}
|
@ -3,9 +3,6 @@
|
||||
"commonjs": true,
|
||||
"es6": true
|
||||
},
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"globals": {
|
||||
"cancelAnimationFrame": false,
|
||||
"clearImmediate": false,
|
||||
@ -18,14 +15,23 @@
|
||||
"setInterval": false,
|
||||
"setTimeout": false
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"forOf": false,
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"strict": 0,
|
||||
"react/jsx-no-duplicate-props": 2,
|
||||
"react/jsx-no-undef": 2,
|
||||
"react/jsx-uses-react": 2,
|
||||
"react/jsx-uses-vars": 2,
|
||||
"react/no-direct-mutation-state": 1,
|
||||
"react/prefer-es6-class": 1,
|
||||
"react/react-in-jsx-scope": 2
|
Loading…
x
Reference in New Issue
Block a user