Skip to content

Commit d18a6b3

Browse files
authored
Merge pull request #774 from alubbe/consistent-code-quality
Consistent code quality
2 parents 017b68e + cee0a52 commit d18a6b3

File tree

6 files changed

+61
-63
lines changed

6 files changed

+61
-63
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
build
22
dist
33
out
4-
test
5-
spec/manual/public/
4+
spec/manual/public/

.eslintrc

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
{
2-
"extends": "airbnb",
2+
"parserOptions": {
3+
"ecmaVersion": 7,
4+
"sourceType": "script"
5+
},
6+
"extends": [
7+
"airbnb",
8+
"prettier"
9+
],
10+
"parser": "babel-eslint",
311
"env": {
412
"es6": true,
513
"mocha": true,
614
"node": true
715
},
816
"rules": {
9-
"max-len": [1, 160, 2, {"ignoreComments": true}],
10-
"semi": ["error", "always"],
11-
"object-property-newline": ["off", { "allowMultiplePropertiesPerLine": true }],
17+
"comma-dangle": ["error", {"arrays": "always-multiline", "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline", "functions": "never"}],
1218
"func-names": ["off", "never"],
13-
"space-before-function-paren": ["error", "never"],
14-
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
19+
"global-require": ["off"],
20+
"max-len": ["error", {"code": 160, "ignoreComments": true}],
1521
"no-mixed-operators": ["error", {"allowSamePrecedence": true}],
16-
"linebreak-style": ["off"],
17-
"no-use-before-define": ["error", { "variables": false, "classes": false, "functions": false }],
18-
"no-plusplus": ["off"],
19-
"no-underscore-dangle": ["error", { "allowAfterThis": true, "allowAfterSuper": true }],
2022
"no-multi-assign": ["off"],
21-
"one-var": ["off"],
22-
"one-var-declaration-per-line": ["off"],
23-
"vars-on-top": ["off"],
24-
25-
"no-var": ["off"],
26-
"arrow-parens": ["off"],
27-
"no-prototype-builtins": ["off"],
2823
"no-param-reassign": ["off"],
29-
"prefer-arrow-callback": ["off"],
30-
"comma-dangle": ["off"],
31-
"strict": ["off"],
32-
"indent": ["off"],
33-
"object-shorthand": ["off"],
34-
"prefer-template": ["off"],
35-
"object-curly-spacing": ["off"],
36-
"no-unused-expressions": ["off"],
37-
"global-require": ["off"],
3824
"no-path-concat": ["off"],
39-
"prefer-rest-params": ["off"]
25+
"no-plusplus": ["off"],
26+
"no-prototype-builtins": ["off"],
27+
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
28+
"no-underscore-dangle": ["error", { "allowAfterThis": true, "allowAfterSuper": true }],
29+
"no-use-before-define": ["error", { "variables": false, "classes": false, "functions": false }],
30+
"object-property-newline": ["off", { "allowMultiplePropertiesPerLine": true }],
31+
"prefer-destructuring": ["warn"],
32+
"prefer-rest-params": ["off"],
33+
"quotes": ["error", "single"],
34+
"semi": ["error", "always"],
35+
"space-before-function-paren": ["error", "never"],
36+
"strict": ["off"]
4037
}
41-
}
38+
}

.jshintrc

Lines changed: 0 additions & 26 deletions
This file was deleted.

.prettier

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"bracketSpacing": false,
3+
"printWidth": 160,
4+
"trailingComma": "all"
5+
}

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
dist
3+
out
4+
spec/manual/public/

package.json

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
"engines": {
1616
"node": ">=6.0.0"
1717
},
18+
"husky": {
19+
"hooks": {
20+
"pre-commit": "lint-staged"
21+
}
22+
},
23+
"lint-staged": {
24+
"*.js": [
25+
"prettier-eslint --write",
26+
"eslint --format node_modules/eslint-friendly-formatter",
27+
"git add"
28+
]
29+
},
1830
"scripts": {
1931
"pretest": "npm run build",
2032
"test": "npm run test:full",
@@ -26,7 +38,8 @@
2638
"test:native-integration": "export EXCEL_NATIVE=yes && mocha --require spec/config/setup spec/integration --recursive",
2739
"test:manual": "node spec/manual/app.js",
2840
"clean-build": "npm run clean && npm run build",
29-
"lint": "eslint --ext .js lib spec",
41+
"lint": "eslint --format node_modules/eslint-friendly-formatter .",
42+
"lint:fix": "prettier-eslint --write \"**/*.js\"",
3043
"clean": "rm -rf build/ && rm -rf dist",
3144
"build": "./node_modules/.bin/grunt build",
3245
"preversion": "npm run clean && npm run build && npm run test:full",
@@ -69,7 +82,7 @@
6982
"tmp": "^0.1.0"
7083
},
7184
"devDependencies": {
72-
"babel-eslint": "^7.2.0",
85+
"babel-eslint": "^10.0.0",
7386
"babel-polyfill": "^6.23.0",
7487
"babel-preset-es2015": "^6.22.0",
7588
"bluebird": "^3.4.7",
@@ -78,11 +91,13 @@
7891
"chai-datetime": "*",
7992
"chai-xml": "*",
8093
"dirty-chai": "^1.2.2",
81-
"eslint": "^3.18.0",
82-
"eslint-config-airbnb": "^14.1.0",
83-
"eslint-plugin-import": "^2.2.0",
84-
"eslint-plugin-jsx-a11y": "^3.0.2",
85-
"eslint-plugin-react": "^6.10.3",
94+
"eslint": "5.6.0",
95+
"eslint-config-airbnb": "^17.0.0",
96+
"eslint-config-prettier": "^3.0.1",
97+
"eslint-friendly-formatter": "^4.0.1",
98+
"eslint-plugin-import": "^2.8.0",
99+
"eslint-plugin-jsx-a11y": "^6.1.2",
100+
"eslint-plugin-react": "^7.6.1",
86101
"express": "*",
87102
"grunt": "^1.0.1",
88103
"grunt-babel": "^6.0.0",
@@ -92,8 +107,12 @@
92107
"grunt-contrib-uglify": "^2.1.0",
93108
"grunt-contrib-watch": "^1.0.0",
94109
"grunt-lib-phantomjs": "^1.1.0",
110+
"husky": "^1.3.1",
111+
"lint-staged": "^8.1.5",
95112
"memorystream": "*",
96113
"mocha": "*",
114+
"prettier-eslint": "^8.8.1",
115+
"prettier-eslint-cli": "^4.6.1",
97116
"request": "*",
98117
"semver": "*",
99118
"uglifyjs": "^2.4.10"

0 commit comments

Comments
 (0)