Skip to content

Commit

Permalink
chore: Simplify eslint configuration (#548)
Browse files Browse the repository at this point in the history
* Fix Fuselage eslintrc

* Use wildcards in eslint.workingDirectories

* Upgrade eslint deps
  • Loading branch information
tassoevan authored Sep 25, 2021
1 parent 0cc10e1 commit 8efa32f
Show file tree
Hide file tree
Showing 23 changed files with 800 additions and 628 deletions.
82 changes: 3 additions & 79 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,100 +1,24 @@
{
"eslint.workingDirectories": [
{
"directory": "packages/css-in-js",
"changeProcessCWD": true
},
{
"directory": "packages/emitter",
"changeProcessCWD": true
},
{
"directory": "packages/eslint-config-alt",
"changeProcessCWD": true
},
{
"directory": "packages/fuselage",
"changeProcessCWD": true
},
{
"directory": "packages/fuselage-hooks",
"changeProcessCWD": true
},
{
"directory": "packages/fuselage-ui-kit",
"changeProcessCWD": true
},
{
"directory": "packages/icons",
"changeProcessCWD": true
},
{
"directory": "packages/memo",
"changeProcessCWD": true
},
{
"directory": "packages/message-parser",
"changeProcessCWD": true
},
{
"directory": "packages/mp3-encoder",
"changeProcessCWD": true
},
{
"directory": "packages/onboarding-ui",
"changeProcessCWD": true
},
{
"directory": "packages/peggy-loader",
"changeProcessCWD": true
},
{
"directory": "packages/prettier-config",
"changeProcessCWD": true
},
{
"directory": "packages/string-helpers",
"changeProcessCWD": true
},
{
"directory": "packages/ui-kit",
"directory": "packages/*",
"changeProcessCWD": true
},
{
"directory": "scripts",
"changeProcessCWD": true
},
{
"directory": "packages/styled",
"changeProcessCWD": true
},
{
"directory": "packages/css-supports",
"changeProcessCWD": true
},
{
"directory": "packages/stylis-logical-props-middleware",
"changeProcessCWD": true
}
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.options": {
"extensions": [
".js",
".jsx",
".md",
".mdx",
".ts",
".tsx",
".pegjs"
]
"extensions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx", ".pegjs"]
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[pegjs]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
}
13 changes: 0 additions & 13 deletions _templates/create-package/library/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ module.exports = {
message: "What's the package version?",
}));

const settings = JSON.parse(
await fs.promises.readFile(".vscode/settings.json")
);
settings["eslint.workingDirectories"].push({
directory: `packages/${package}`,
changeProcessCWD: true,
});
await fs.promises.writeFile(
".vscode/settings.json",
JSON.stringify(settings, null, 2),
"utf-8"
);

return {
package,
description,
Expand Down
2 changes: 1 addition & 1 deletion packages/css-in-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^27.0.2",
"@types/stylis": "^4.0.1",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"prettier": "^2.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/emitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^27.0.2",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
16 changes: 8 additions & 8 deletions packages/eslint-config-alt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
"prettier": "^2.3.2"
},
"devDependencies": {
"@babel/eslint-parser": "^7.14.7",
"eslint": "^7.29.0",
"@babel/eslint-parser": "^7.15.7",
"eslint": "^7.32.0",
"lint-staged": "^11.0.0",
"prettier": "^2.3.2"
},
"dependencies": {
"@rocket.chat/eslint-config": "^0.4.0",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.0",
"eslint-plugin-react-hooks": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/fuselage-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/react-dom": "^17.0.9",
"@types/resize-observer-browser": "^0.1.6",
"@types/use-subscription": "^1.0.0",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage-polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"lint-staged": "^11.0.0",
"prettier": "^2.3.2"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/fuselage-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-prettier": "^4.0.0",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage-ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@storybook/theming": "^6.3.4",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"lint-staged": "^11.0.0",
"loki": "^0.28.1",
"normalize.css": "^8.0.1",
Expand Down
9 changes: 7 additions & 2 deletions packages/fuselage/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = {
extends: '@rocket.chat/eslint-config-alt/react',
extends: '@rocket.chat/eslint-config-alt/typescript',
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'react/display-name': 'off',
'react/no-multi-comp': 'off',
},
Expand All @@ -11,7 +13,10 @@ module.exports = {
overrides: [
{
files: ['*.mdx'],
extends: ['plugin:mdx/recommended'],
extends: [
'@rocket.chat/eslint-config-alt/react',
'plugin:mdx/recommended',
],
parserOptions: {
parser: '@babel/eslint-parser',
},
Expand Down
14 changes: 7 additions & 7 deletions packages/fuselage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
"react-keyed-flatten-children": "^1.3.0"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.14.7",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.7",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/preset-react": "^7.14.5",
"@rocket.chat/eslint-config": "^0.4.0",
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
Expand All @@ -93,7 +93,7 @@
"@storybook/react": "^6.3.4",
"@storybook/source-loader": "^6.3.4",
"@storybook/theming": "^6.3.4",
"@types/invariant": "^2.2.34",
"@types/invariant": "^2.2.35",
"@types/jest": "^27.0.2",
"autoprefixer": "^10.2.6",
"babel-loader": "^8.2.2",
Expand All @@ -103,8 +103,8 @@
"css-loader": "^5.2.6",
"cssnano": "^5.0.6",
"es-check": "^6.0.0",
"eslint": "^7.29.0",
"eslint-plugin-mdx": "^1.13.0",
"eslint": "^7.32.0",
"eslint-plugin-mdx": "^1.15.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"glob": "^7.1.7",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/memo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/message-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@
"docs": "typedoc"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "^7.14.7",
"@babel/preset-env": "^7.14.7",
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.7",
"@babel/preset-env": "^7.15.6",
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/peggy-loader": "workspace:packages/peggy-loader",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"@types/jest": "^27.0.2",
"@types/node": "^15.14.1",
"@typescript-eslint/parser": "^4.28.2",
"@typescript-eslint/parser": "^4.31.2",
"babel-loader": "^8.2.2",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
10 changes: 5 additions & 5 deletions packages/mp3-encoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
"lamejs": "https://github.com/zhuker/lamejs.git#commit=564612b5b57336238a5920ba4c301b49f7cb2bab"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.14.5",
"@babel/core": "^7.15.5",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/preset-typescript": "^7.15.0",
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^27.0.2",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"prettier": "^2.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/onboarding-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"countries-list": "^2.6.1",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"loki": "^0.28.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/peggy-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"@types/loader-utils": "^2.0.3",
"@types/node": "^15.14.1",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
"peggy": "^1.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
},
"devDependencies": {
"@rocket.chat/eslint-config": "^0.4.0",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-prettier": "^4.0.0",
"lint-staged": "^11.0.0",
"prettier": "^2.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/string-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"@types/jest": "^27.0.2",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@rocket.chat/eslint-config-alt": "workspace:packages/eslint-config-alt",
"@rocket.chat/prettier-config": "workspace:packages/prettier-config",
"@types/jest": "^27.0.2",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"jest": "^27.2.1",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
Loading

0 comments on commit 8efa32f

Please sign in to comment.