Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure ESLint rules for shared folders, bump ESLint deps #453

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-meaningless-void-operator": "error",
"no-use-before-define": "off",
"@typescript-eslint/no-misused-promises": [
"error", // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn
{ "checksVoidReturn": { "attributes": false, "properties": false } }
],
Comment on lines +224 to +227
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make this rule a bit more loose after upgrading "@typescript-eslint/eslint-plugin". See typescript-eslint/typescript-eslint#4650 and https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md#checksvoidreturn for context. The rule is not less strict that it was.

"@typescript-eslint/no-use-before-define": ["error"],

// Part of @typescript-eslint/recommended-requiring-type-checking
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/callout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
12 changes: 6 additions & 6 deletions packages/blocks/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@types/prismjs": "1.16.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"babel-plugin-prismjs": "2.0.1",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"css-loader": "5.2.6",
"eslint": "8.8.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint": "8.12.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/divider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"graphql": "15.5.1",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/html-para/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"serve": "serve -C -l 5005"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"copy-webpack-plugin": "^4.6.0",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"serve": "13.0.2"
},
"blockprotocol": {
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/paragraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/person/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@types/dompurify": "2.3.3",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"css-loader": "5.2.6",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
14 changes: 7 additions & 7 deletions packages/blocks/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@
"@babel/runtime": "^7.12.5",
"@types/react-dom": "17.0.8",
"@types/react-table": "7.7.1",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"css-loader": "5.2.6",
"eslint": "8.8.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
12 changes: 6 additions & 6 deletions packages/blocks/video/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "7.13.0",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"babel-loader": "^8.2.2",
"concurrently": "7.0.0",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^2.6.12",
"cross-env": "7.0.3",
"eslint": "8.8.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint": "8.12.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"html-webpack-plugin-v4": "npm:html-webpack-plugin@4.5.1",
"mock-block-dock": "0.0.6",
"react": "17.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/hash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ The below `package.json` file outlines the minimum requirements a package has to
"postinstall": "yarn build"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.3.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/hash/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@
"@types/prosemirror-model": "1.16.0",
"@types/prosemirror-transform": "1.1.5",
"@types/rword": "3.0.0",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"eslint": "8.8.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/parser": "5.17.0",
"eslint": "8.12.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.3.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.0",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "4.3.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"jest": "27.1.1",
"rimraf": "^3.0.2",
"ts-jest": "27.0.5",
Expand Down
9 changes: 8 additions & 1 deletion packages/hash/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "canonical", "unicorn"],
"rules": {
"jsx-a11y/label-has-associated-control": "off",
"import/no-default-export": "error",
Expand Down Expand Up @@ -47,6 +47,13 @@
"rules": {
"import/no-default-export": "off"
}
},
{
"files": ["**/shared/**/*"],
"rules": {
"canonical/filename-no-index": "error",
"unicorn/filename-case": "error"
}
}
Comment on lines +51 to 57
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main part of the PR

]
}