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

H-2457: Improved ESLint configuration #4232

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0066064
feat: overrides
indietyp Mar 23, 2024
7a84be6
feat: prevent abbreviations
indietyp Mar 23, 2024
3800977
feat: refine configuration
indietyp Mar 23, 2024
9fc7545
feat: split up into multiple files
indietyp Mar 24, 2024
e732223
fix: eslint
indietyp Mar 24, 2024
0ea73fe
feat: actually check in package.json
indietyp Mar 24, 2024
3ed7b84
feat: react changes
indietyp Mar 24, 2024
9245166
chore: TODO
indietyp Mar 24, 2024
c98c32a
feat: do not force JSX expressions on children
indietyp Mar 24, 2024
f363041
feat: remove annoying rules
indietyp Mar 24, 2024
d372a2f
feat: apply eslint changes
indietyp Mar 24, 2024
45c5a65
feat: apply changes from downstream
indietyp Mar 24, 2024
8a0d856
feat: make draft variable regex configurable
indietyp Mar 24, 2024
0c05357
feat: configurable frontend
indietyp Mar 25, 2024
4a65bc8
chore: don’t allow `false`
indietyp Mar 25, 2024
fea7b7e
fix: postinstall
indietyp Mar 25, 2024
2af6e3e
fix: dependencies?
indietyp Mar 25, 2024
24ab8bf
fix: dependencies?
indietyp Mar 25, 2024
9061e05
Merge remote-tracking branch 'origin/main' into bm/repo/eslint
indietyp Jul 18, 2024
2d5652a
feat: adjust eslint
indietyp Jul 18, 2024
1a27c90
feat: postinstall
indietyp Jul 18, 2024
cd1760d
fix: no-void
indietyp Jul 18, 2024
95de10d
chore: update dependencies
indietyp Jul 18, 2024
3ac2b5a
feat: eslint for every package
indietyp Jul 19, 2024
0fbb7ff
feat: convert blocks
indietyp Jul 19, 2024
9bdf52e
fix: lint
indietyp Jul 19, 2024
c08ef37
Merge remote-tracking branch 'origin/main' into bm/repo/eslint
indietyp Jul 19, 2024
ebd7f8c
feat: tests
indietyp Jul 19, 2024
5c9d5f5
chore: remove eslint files
indietyp Jul 19, 2024
22168c8
feat: remove last old configuration
indietyp Jul 19, 2024
b8250a9
chore: remove eslint-config
indietyp Jul 19, 2024
6fb51de
fix: prettier
indietyp Jul 19, 2024
8b31a34
chore: disable storybook (temporarily)
indietyp Jul 19, 2024
801cdc7
chore: prettier
indietyp Jul 19, 2024
ab1ee49
fix: malformed eslint config
indietyp Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
## Files uniquely ignored by Prettier and ESLint
################################################

# NOTE: `libs/@local/eslint-config/generate-ignore-patterns.cjs` is used to generate ESLint ignore patterns based on
# this file

# Ignore all files (but still allow sub-folder scanning)
*
!*/
Expand Down
7 changes: 0 additions & 7 deletions apps/hash-ai-worker-ts/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions apps/hash-ai-worker-ts/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from "@local/eslint";

export default create({
enabled: {
frontend: false,
playwright: false,
tests: true,
},
});
4 changes: 2 additions & 2 deletions apps/hash-ai-worker-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"typescript": "5.5.3"
},
"devDependencies": {
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@sentry/cli": "2.31.0",
"@types/dedent": "0.7.0",
Expand All @@ -101,7 +101,7 @@
"@types/papaparse": "5.3.14",
"@types/sanitize-html": "2.11.0",
"@vitest/coverage-istanbul": "2.0.3",
"eslint": "8.57.0",
"eslint": "^8.57.0",
"rimraf": "6.0.1",
"vite-tsconfig-paths": "4.3.2",
"vitest": "2.0.3"
Expand Down
22 changes: 0 additions & 22 deletions apps/hash-api/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions apps/hash-api/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from "@local/eslint";

export default create({
enabled: {
frontend: false,
playwright: false,
tests: true,
},
});
4 changes: 2 additions & 2 deletions apps/hash-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@graphql-codegen/introspection": "2.2.3",
"@graphql-codegen/typescript": "2.8.7",
"@graphql-codegen/typescript-resolvers": "2.7.12",
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@types/app-root-path": "1.2.4",
"@types/dedent": "0.7.0",
Expand All @@ -116,7 +116,7 @@
"@types/mime-types": "2.1.1",
"@types/nodemailer": "6.4.6",
"@vitest/coverage-istanbul": "2.0.3",
"eslint": "8.57.0",
"eslint": "^8.57.0",
"rimraf": "6.0.1",
"vitest": "2.0.3"
}
Expand Down
88 changes: 0 additions & 88 deletions apps/hash-frontend/.eslintrc.cjs

This file was deleted.

69 changes: 69 additions & 0 deletions apps/hash-frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { create } from "@local/eslint";

export default create({
enabled: {
frontend: "next",
playwright: false,
tests: false,
},
noRestrictedImports: () => [
{
paths: [
{
name: "next",
importNames: ["Link"],
message:
"Please use the custom wrapper component in src/shared/ui component instead to ensure Next.js and MUI compatibility.",
},
{
name: "next/link",
message:
"Please use the custom wrapper component in src/shared/ui component instead to ensure Next.js and MUI compatibility.",
},
{
name: "@mui/material",
importNames: [
"Avatar",
"IconButton",
"Chip",
"TextField",
"Select",
"Link",
"Button",
"MenuItem",
"Tabs",
],
message:
"Please use the custom wrapper component from src/shared/ui for Link, Button, Tabs and MenuItem and from '@hashintel/design-system' for every other component.",
},
{
name: "notistack",
importNames: ["useSnackbar"],
message:
"Please use the custom src/components/hooks/useSnackbar hook instead.",
},
{
name: "@hashintel/design-system",
importNames: ["Button", "Link", "MenuItem"],
message:
"Please use the custom wrapper component in src/shared/ui component instead",
},
],
patterns: [
{
group: ["@mui/material/*"],
message: "Please import from @mui/material instead",
},
{
group: [
"@hashintel/design-system/*",
"!@hashintel/design-system/theme",
"!@hashintel/design-system/constants",
],
message: "Please import from @hashintel/design-system instead",
},
],
},
],
mutableParametersRegex: () => ["^draft"],
});
4 changes: 2 additions & 2 deletions apps/hash-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"@graphql-codegen/fragment-matcher": "3.3.3",
"@graphql-codegen/typescript": "2.8.7",
"@graphql-codegen/typescript-operations": "2.5.12",
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@next/bundle-analyzer": "12.3.1",
"@types/dotenv-flow": "3.2.0",
Expand All @@ -131,7 +131,7 @@
"@types/react-dom": "18.2.25",
"@types/url-regex-safe": "1.0.0",
"@types/uuid": "8.3.0",
"eslint": "8.57.0",
"eslint": "^8.57.0",
"rimraf": "6.0.1",
"sass": "1.57.1",
"typescript": "5.5.3",
Expand Down
10 changes: 0 additions & 10 deletions apps/hash-graph/.eslintrc.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions apps/hash-integration-worker/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions apps/hash-integration-worker/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from "@local/eslint";

export default create({
enabled: {
frontend: false,
playwright: false,
tests: false,
},
});
4 changes: 2 additions & 2 deletions apps/hash-integration-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"typescript": "5.5.3"
},
"devDependencies": {
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@sentry/cli": "2.31.0",
"@types/dotenv-flow": "3.2.0",
"eslint": "8.57.0",
"eslint": "^8.57.0",
"rimraf": "6.0.1"
}
}
7 changes: 0 additions & 7 deletions apps/hash-realtime/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions apps/hash-realtime/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from "@local/eslint";

export default create({
enabled: {
frontend: false,
playwright: false,
tests: false,
},
});
4 changes: 2 additions & 2 deletions apps/hash-realtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"typescript": "5.5.3"
},
"devDependencies": {
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@types/node": "20.12.3",
"@types/set-interval-async": "1.0.0",
"eslint": "8.57.0"
"eslint": "^8.57.0"
}
}
13 changes: 0 additions & 13 deletions apps/hash-search-loader/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions apps/hash-search-loader/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from "@local/eslint";

export default create({
enabled: {
frontend: false,
playwright: false,
tests: false,
},
});
4 changes: 2 additions & 2 deletions apps/hash-search-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"typescript": "5.5.3"
},
"devDependencies": {
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@types/node": "20.12.3",
"eslint": "8.57.0"
"eslint": "^8.57.0"
}
}
2 changes: 1 addition & 1 deletion apps/hashdotdesign/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@babel/preset-typescript": "7.23.3",
"@hashintel/block-design-system": "0.0.2",
"@hashintel/design-system": "0.0.8",
"@local/eslint-config": "0.0.0-private",
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@storybook/addon-essentials": "7.0.5",
"@storybook/addon-interactions": "7.0.5",
Expand Down
Loading
Loading