Skip to content

Commit

Permalink
fix: reintroduce custom eslint (#284)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Howard <[email protected]>
  • Loading branch information
stefl and codeincontext authored Oct 29, 2024
1 parent 5aaa1d9 commit adc1efa
Show file tree
Hide file tree
Showing 9 changed files with 553 additions and 468 deletions.
7 changes: 1 addition & 6 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: ["eslint-config-custom"],
parserOptions: {
tsconfigRootDir: __dirname,
project: [
Expand All @@ -10,9 +10,4 @@ module.exports = {
"./packages/*/tsconfig.json",
],
},
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
"no-console": "warn"
}
};
3 changes: 3 additions & 0 deletions apps/nextjs/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ module.exports = {
},
],
},
parserOptions: {
project: __dirname + "/tsconfig.json",
},
};
2 changes: 1 addition & 1 deletion apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"concurrently": "^8.2.2",
"dotenv-cli": "^6.0.0",
"eslint": "^8.56.0",
"eslint-config-next": "14.0.4",
"eslint-config-next": "15.0.1",
"eslint-plugin-storybook": "^0.8.0",
"graphql": "^16.9.0",
"jest": "^29.7.0",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"doppler:run:stg": "doppler run -c stg --silent",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"lint": "turbo lint",
"lint:fix": "pnpm lint -- --fix",
"prompts": "turbo prompts",
"prompts:dev": "turbo prompts:dev",
"sort-package-json": "sort-package-json \"package.json\" \"packages/*/package.json\" \"apps/*/package.json\"",
Expand All @@ -48,6 +49,7 @@
"@types/jest": "^29.5.12",
"autoprefixer": "^10.4.16",
"eslint-config-custom": "0.0.0",
"eslint-plugin-turbo": "^2.2.3",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"next": "14.2.5",
Expand Down
24 changes: 3 additions & 21 deletions packages/aila/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["../../.eslintrc.cjs", "next"],
//plugins: ["import"],
rules: {
// ... other rules ...
// "import/order": [
// "error",
// {
// groups: [
// "builtin",
// "external",
// "internal",
// "parent",
// "sibling",
// "index",
// ],
// alphabetize: {
// order: "asc",
// caseInsensitive: true,
// },
// },
// ],
extends: ["eslint-config-custom"],
parserOptions: {
project: __dirname + "/tsconfig.json",
},
};
2 changes: 1 addition & 1 deletion packages/db/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["index.ts", "prisma/**/*.ts"]
"include": ["index.ts", "prisma/**/*.ts", "client/index.ts"]
}
28 changes: 23 additions & 5 deletions packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ["eslint:recommended", "prettier"],
plugins: ["turbo", "@typescript-eslint"],
plugins: ["turbo", "@typescript-eslint",],
ignorePatterns: ["node_modules", "dist", "../../node_modules", "../../dist"],
root: true,
env: {
Expand All @@ -20,9 +20,30 @@ module.exports = {
parser: "@typescript-eslint/parser",
files: ["*.{ts,tsx}"],
rules: {
"@typescript-eslint/quotes": ["error", "double"],
"no-console": "warn",
"no-extra-boolean-cast": "warn",
"no-useless-escape": "warn",
"no-unsafe-finally": "warn",
"no-constant-condition": "warn",
"no-prototype-builtins": "warn",
"no-inner-declarations": "warn",
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/comma-dangle": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/explicit-function-return-type": [
"off",
{
Expand All @@ -44,7 +65,4 @@ module.exports = {
},
},
],
rules: {
quotes: ["error", "double"],
},
};
13 changes: 7 additions & 6 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/typescript-estree": "^7.18.0",
"eslint-config-next": "14.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-turbo": "^1.11.2"
"eslint-config-next": "15.0.1",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-turbo": "^2.2.3"
},
"devDependencies": {
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.1.1",
"typescript": "5.3.3"
},
Expand Down
Loading

0 comments on commit adc1efa

Please sign in to comment.