Add: Issue #92 prettier + husky + lint-staged
This commit is contained in:
committed by
Aleksei Gurianov
parent
fea398483e
commit
dec8bb4fc9
+4
-11
@@ -1,9 +1,7 @@
|
||||
module.exports = {
|
||||
parser: 'babel-eslint',
|
||||
extends: 'eslint:recommended',
|
||||
plugins: [
|
||||
'react',
|
||||
],
|
||||
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
|
||||
plugins: ['react', 'prettier'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
@@ -23,16 +21,11 @@ module.exports = {
|
||||
rules: {
|
||||
'react/jsx-uses-react': 2,
|
||||
'react/jsx-uses-vars': 2,
|
||||
'no-unused-vars': [1, {varsIgnorePattern: '^h$'}],
|
||||
'no-cond-assign': 1,
|
||||
'no-empty': 0,
|
||||
'no-console': 1,
|
||||
semi: 2,
|
||||
camelcase: 0,
|
||||
'comma-style': 2,
|
||||
indent: [2, 2, {SwitchCase: 1}],
|
||||
'no-mixed-spaces-and-tabs': [2, 'smart-tabs'],
|
||||
'no-trailing-spaces': [2, {skipBlankLines: true}],
|
||||
'max-nested-callbacks': [2, 3],
|
||||
'no-eval': 2,
|
||||
'no-implied-eval': 2,
|
||||
@@ -51,7 +44,6 @@ module.exports = {
|
||||
'no-shadow-restricted-names': 2,
|
||||
'handle-callback-err': 0,
|
||||
'no-lonely-if': 2,
|
||||
'keyword-spacing': 2,
|
||||
'constructor-super': 2,
|
||||
'no-this-before-super': 2,
|
||||
'no-dupe-class-members': 2,
|
||||
@@ -61,5 +53,6 @@ module.exports = {
|
||||
'no-var': 2,
|
||||
'object-shorthand': 2,
|
||||
'prefer-arrow-callback': 2,
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
@@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
printWidth: 120,
|
||||
useTabs: false,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
trailingComma: 'es5',
|
||||
bracketSpacing: true,
|
||||
arrowParens: 'avoid',
|
||||
};
|
||||
Generated
+3880
-2891
File diff suppressed because it is too large
Load Diff
+20
-2
@@ -6,7 +6,20 @@
|
||||
"start": "webpack-dev-server --progress --hot --inline --config ./webpack.config.js",
|
||||
"reinstall": "rm -rf ./node_modules/ && npm install",
|
||||
"lint": "eslint --ext=.js,.jsx .",
|
||||
"test": "jest"
|
||||
"test": "jest",
|
||||
"prettier": "prettier --write \"./**/*.{js,jsx,scss}\"",
|
||||
"precommit": "./node_modules/.bin/lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"./app/**/*.{js,jsx}": [
|
||||
"prettier --write",
|
||||
"git add",
|
||||
"eslint --fix"
|
||||
],
|
||||
"./app/**/*.scss": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.2.6",
|
||||
@@ -23,16 +36,21 @@
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^0.28.11",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-react": "^7.9.1",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-prettier": "^2.6.1",
|
||||
"eslint-plugin-react": "^7.10.0",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"file-loader": "^0.11.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^23.1.0",
|
||||
"lint-staged": "^7.2.0",
|
||||
"node-sass": "sass/node-sass#v5",
|
||||
"postcss-csso": "^2.0.0",
|
||||
"postcss-loader": "^2.1.5",
|
||||
"postcss-url": "^6.3.1",
|
||||
"postcss-wrap": "0.0.4",
|
||||
"prettier": "^1.13.7",
|
||||
"sass-loader": "^6.0.7",
|
||||
"style-loader": "^0.19.1",
|
||||
"webpack": "^3.12.0",
|
||||
|
||||
Reference in New Issue
Block a user