Share global eslint opt and move prettier config

Share global eslint config from its root project to keep it low maintenance and reduce dry code

Also move prettier config to it's own object to make all files including css, json, etc follows this rules, otherwise this rules will only works on eslint coverage files
pull/339/head
Rafly Maulana 3 years ago
parent 064b37050c
commit 0088646b70
No known key found for this signature in database
GPG Key ID: 9AADAF05ED276842

@ -34,13 +34,10 @@
},
"requireConfigFile": false
},
"plugins": [
"prettier"
],
"extends": [
"airbnb",
"airbnb/hooks",
"plugin:prettier/recommended"
"../package.json"
],
"rules": {
"import/no-extraneous-dependencies": [
@ -51,14 +48,6 @@
"**/*.test.js"
]
}
],
"prettier/prettier": [
"error",
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all"
}
]
}
},
@ -112,14 +101,11 @@
"enzyme": "^3.11.0",
"eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest-enzyme": "^7.1.2",
"prettier": "2.7.1",
"react-app-rewired": "^2.2.1",
"react-test-renderer": "^17.0.2"
}

@ -38,9 +38,34 @@
"npm run server:lint"
]
},
"eslintConfig": {
"plugins": [
"prettier"
],
"extends": [
"plugin:prettier/recommended"
],
"rules": {
"no-throw-literal": "off",
"no-undef": "off",
"prettier/prettier": "error"
}
},
"prettier": {
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "lf"
},
"dependencies": {
"concurrently": "^7.3.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3"
},
"devDependencies": {
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1"
}
}

@ -13,24 +13,13 @@
"test": "mocha test/lifecycle.test.js test/integration/**/*.test.js test/utils/**/*.test.js"
},
"eslintConfig": {
"plugins": [
"prettier"
],
"extends": [
"airbnb-base",
"plugin:prettier/recommended"
"../package.json"
],
"rules": {
"no-throw-literal": "off",
"no-undef": "off",
"prettier/prettier": [
"error",
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all"
}
]
"no-undef": "off"
},
"globals": {
"_": true,
@ -63,12 +52,9 @@
"chai": "^4.3.6",
"eslint": "^8.20.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"mocha": "^9.2.2",
"nodemon": "^2.0.19",
"prettier": "2.7.1",
"supertest": "^6.2.4"
},
"engines": {

Loading…
Cancel
Save