Skip to content

Commit b0143d2

Browse files
authored
updated tests to run linter (#388)
* updated tests to run linter
1 parent 0fd7ee8 commit b0143d2

File tree

6 files changed

+117
-107
lines changed

6 files changed

+117
-107
lines changed

.eslintrc.js

Lines changed: 99 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,100 @@
11
module.exports = {
2-
"env": {
3-
"commonjs": true,
4-
"es6": true,
5-
"node": true
6-
},
7-
"extends": "airbnb-base",
8-
"globals": {
9-
"Atomics": "readonly",
10-
"SharedArrayBuffer": "readonly"
11-
},
12-
"parserOptions": {
13-
"ecmaVersion": 2018
14-
},
15-
"rules": {
16-
"camelcase": "off",
17-
// "class-methods-use-this": "off",
18-
"comma-dangle": ["error", {
19-
"functions": "ignore",
20-
"arrays": "always-multiline",
21-
"objects": "always-multiline",
22-
"imports": "always-multiline",
23-
"exports": "always-multiline",
24-
}],
25-
// "consistent-return": "off",
26-
// "dot-notation": "off",
27-
"func-names": "off",
28-
"global-require": "off",
29-
// "guard-for-in": "off",
30-
// "import/newline-after-import": "off",
31-
"import/no-dynamic-require": "off",
32-
// "import/order": "off",
33-
"max-len": [
34-
"warn",
35-
{
36-
"code": 120,
37-
"ignoreComments": false,
38-
"ignoreRegExpLiterals": true,
39-
"ignoreStrings": true,
40-
"ignoreTemplateLiterals": true,
41-
"ignoreTrailingComments": false,
42-
"ignoreUrls": true,
43-
"tabWidth": 2
44-
}
45-
],
46-
// "new-cap": "off",
47-
"newline-per-chained-call": "off",
48-
// "no-bitwise": "off",
49-
// "no-buffer-constructor": "off",
50-
// "no-cond-assign": "off",
51-
// "no-confusing-arrow": "off",
52-
"no-console": "off",
53-
// "no-dupe-keys": "off",
54-
// "no-else-return": "off",
55-
// "no-empty": "off",
56-
// "no-empty-function": "off",
57-
// "no-lonely-if": "off",
58-
// "no-loop-func": "off",
59-
// "no-mixed-operators": "off",
60-
// "no-multi-assign": "off",
61-
"no-param-reassign": "off",
62-
"no-plusplus": "off",
63-
"no-prototype-builtins": "off",
64-
// "no-restricted-syntax": "off",
65-
// "no-return-assign": "off",
66-
// "no-shadow": "off",
67-
"no-throw-literal": "off",
68-
// "no-unreachable": "off",
69-
"no-unused-vars": ["error", {
70-
"args": "none",
71-
"caughtErrors": "none"
72-
}],
73-
"no-trailing-spaces": ['error',{
74-
"skipBlankLines" : true
75-
}],
76-
"no-use-before-define": "off",
77-
"no-useless-concat": "off",
78-
"no-useless-constructor": "off",
79-
"no-useless-escape": "off",
80-
"no-var": "off",
81-
"no-void": "off",
82-
"object-curly-newline": [
83-
"error",
84-
{
85-
"consistent": true
86-
}
87-
],
88-
"object-shorthand": "off",
89-
"one-var": "off",
90-
"one-var-declaration-per-line": "off",
91-
"operator-assignment": "off",
92-
"prefer-arrow-callback": "off",
93-
"prefer-const": "off",
94-
"prefer-destructuring": "off",
95-
"prefer-template": "off",
96-
"quote-props": "off",
97-
"quotes": "off",
98-
"radix": "off",
99-
"vars-on-top": "off",
100-
"wrap-iife": "off"
101-
}
102-
}
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es6": true
6+
},
7+
"extends": "airbnb-base",
8+
"globals": {
9+
"Atomics": "readonly",
10+
"SharedArrayBuffer": "readonly"
11+
},
12+
"parserOptions": {
13+
"ecmaVersion": 2018
14+
},
15+
"rules": {
16+
"arrow-body-style": "off",
17+
"arrow-spacing": "off",
18+
"arrow-parens": "off",
19+
"camelcase": "off",
20+
"class-methods-use-this": "off",
21+
"comma-dangle": "off",
22+
"comma-spacing": "off",
23+
"consistent-return": "off",
24+
"dot-notation": "off",
25+
"function-paren-newline": "off",
26+
"func-names": "off",
27+
"global-require": "off",
28+
"guard-for-in": "off",
29+
"indent": "off",
30+
"import/no-extraneous-dependencies": "off",
31+
"import/no-unresolved": "off",
32+
"import/newline-after-import": "off",
33+
"import/no-dynamic-require": "off",
34+
"import/order": "off",
35+
"max-len": "off",
36+
"new-cap": "off",
37+
"newline-per-chained-call": "off",
38+
"no-unused-expressions": "off",
39+
"no-useless-catch": "off",
40+
"no-underscore-dangle": "off",
41+
"no-bitwise": "off",
42+
"no-buffer-constructor": "off",
43+
"no-cond-assign": "off",
44+
"no-confusing-arrow": "off",
45+
"no-console": "off",
46+
"no-dupe-keys": "off",
47+
"no-else-return": "off",
48+
"no-empty": "off",
49+
"no-empty-function": "off",
50+
"no-lonely-if": "off",
51+
"no-loop-func": "off",
52+
"no-mixed-operators": "off",
53+
"no-multi-assign": "off",
54+
"no-param-reassign": "off",
55+
"no-plusplus": "off",
56+
"no-prototype-builtins": "off",
57+
"no-restricted-syntax": "off",
58+
"no-return-assign": "off",
59+
"no-shadow": "off",
60+
"no-throw-literal": "off",
61+
"no-unreachable": "off",
62+
"no-unused-vars": "off",
63+
"no-trailing-spaces": ['error',{
64+
"skipBlankLines" : true
65+
}],
66+
"no-multiple-empty-lines": "off",
67+
"no-use-before-define": "off",
68+
"no-useless-concat": "off",
69+
"no-useless-constructor": "off",
70+
"no-useless-escape": "off",
71+
"no-var": "off",
72+
"no-void": "off",
73+
"object-curly-spacing": "off",
74+
"object-curly-newline": [
75+
"error",
76+
{
77+
"consistent": true
78+
}
79+
],
80+
"object-shorthand": "off",
81+
"one-var": "off",
82+
"one-var-declaration-per-line": "off",
83+
"operator-linebreak": "off",
84+
"operator-assignment": "off",
85+
"prefer-object-spread": "off",
86+
"prefer-arrow-callback": "off",
87+
"prefer-const": "off",
88+
"prefer-destructuring": "off",
89+
"prefer-template": "off",
90+
"quote-props": "off",
91+
"quotes": "off",
92+
"radix": "off",
93+
"semi": "off",
94+
"space-before-function-paren": 'off',
95+
"space-before-blocks": "off",
96+
"space-infix-ops": "off",
97+
"vars-on-top": "off",
98+
"wrap-iife": "off"
99+
}
100+
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
"babel-runtime": "^6.26.0",
2929
"dotenv": "4.x",
3030
"dtslint": "^0.9.1",
31-
"eslint": "^5.16.0",
32-
"eslint-config-airbnb-base": "^13.1.0",
33-
"eslint-plugin-import": "^2.17.2",
31+
"eslint": "^6.8.0",
32+
"eslint-config-airbnb-base": "^14.1.0",
33+
"eslint-plugin-import": "^2.20.2",
3434
"expect.js": "0.3.x",
3535
"glob": "^7.1.6",
3636
"jsdoc": "^3.5.5",
@@ -56,7 +56,7 @@
5656
"test": "tools/scripts/test.sh",
5757
"test-with-temp-cloud": "tools/scripts/tests-with-temp-cloud.sh",
5858
"dtslint": "tools/scripts/ditslint.sh",
59-
"lint": "eslint .",
59+
"lint": "tools/scripts/lint.sh",
6060
"compile": "tools/scripts/compile.sh",
6161
"coverage": "tools/scripts/test.es6.sh --coverage",
6262
"test-es6": "tools/scripts/test.es6.sh",

tools/scripts/compile.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/bash
22
rimraf ./lib-es5
33
babel lib --out-dir lib-es5 --verbose
4+
npm run lint

tools/scripts/lint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e;
3+
4+
node_v=$(node --version) ;
5+
if [[ "${node_v%%.*}" == 'v4' || "${node_v%%.*}" == 'v6' ]]
6+
then
7+
echo 'Old node version - Skipping eslint'
8+
else
9+
eslint .
10+
fi
11+

tools/scripts/test.es6.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ else
1818
echo 'Running tests on ES6 Code'
1919
mocha --ui bdd -R spec --recursive test/
2020
fi
21-

tools/scripts/test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
set -e;
33

44
node_v=$(node --version) ;
5-
5+
npm run lint
66
if [[ "${node_v%%.*}" == 'v4' || "${node_v%%.*}" == 'v6' ]]
77
then
88
npm run test-es5
99
else
1010
npm run test-es6
1111
fi
1212
npm run dtslint
13+

0 commit comments

Comments
 (0)