Skip to content

Commit 9b0d889

Browse files
maparentmdroidian
andauthored
Eng-521 repair and modernize eslint with flat config (#246)
* ENG-369: eslint with new flat configuration files. * make it work in vscode * coderabbit improvements * make it look closer to turbo skeleton * most additions have no obvious effect * add preferArrows, naming conventions, max-params. (#241) * Update tsconfig.json to include trailing comma in compilerOptions --------- Co-authored-by: Michael Gartner <[email protected]>
1 parent 2b609af commit 9b0d889

30 files changed

+657
-789
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"editor.formatOnSave": true,
33
"prettier.requireConfig": true,
44
"prettier.prettierPath": "./node_modules/prettier",
5-
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"eslint.useFlatConfig": true,
7+
"eslint.workingDirectories": [{ "mode": "auto" }]
68
}

apps/obsidian/eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { config } from "@repo/eslint-config/react-internal";
2+
3+
export default [
4+
...config,
5+
{
6+
languageOptions: {
7+
parserOptions: {
8+
tsconfigRootDir: ".",
9+
project: true,
10+
ecmaFeatures: {
11+
jsx: true,
12+
},
13+
},
14+
},
15+
},
16+
];

apps/obsidian/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@
77
"scripts": {
88
"dev": "tsx scripts/dev.ts",
99
"build": "tsx scripts/build.ts",
10+
"lint": "eslint .",
11+
"lint:fix": "eslint . --fix",
1012
"publish": "tsx scripts/publish-obsidian.ts"
1113
},
1214
"keywords": [],
1315
"author": "",
1416
"license": "Apache-2.0",
1517
"devDependencies": {
1618
"@octokit/core": "^6.1.2",
17-
"@types/node": "^16.11.6",
18-
"@typescript-eslint/eslint-plugin": "5.29.0",
19-
"@typescript-eslint/parser": "5.29.0",
19+
"@types/node": "^20",
2020
"autoprefixer": "^10.4.21",
2121
"builtin-modules": "3.3.0",
2222
"dotenv": "^16.4.5",
2323
"esbuild": "0.17.3",
2424
"obsidian": "^1.7.2",
2525
"postcss": "^8.5.3",
2626
"tailwindcss": "^3.4.17",
27-
"tslib": "2.4.0",
27+
"tslib": "2.5.1",
2828
"tsx": "^4.19.2",
29-
"typescript": "4.7.4"
29+
"typescript": "5.5.4"
3030
},
3131
"dependencies": {
3232
"react": "^19.0.0",
3333
"react-dom": "^19.0.0",
3434
"tailwindcss-animate": "^1.0.7"
3535
}
36-
}
36+
}

apps/obsidian/tsconfig.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
22
"extends": "@repo/typescript-config/react-library.json",
3+
"include": ["**/*.ts"],
34
"compilerOptions": {
45
"baseUrl": ".",
6+
"rootDir": ".",
57
"inlineSourceMap": true,
68
"inlineSources": true,
7-
"module": "ESNext",
89
"target": "ES6",
910
"allowJs": true,
1011
"noImplicitAny": true,
11-
"moduleResolution": "node",
1212
"importHelpers": true,
1313
"isolatedModules": true,
1414
"strictNullChecks": true,
15-
"lib": ["DOM", "ES5", "ES6", "ES7"]
16-
},
17-
"include": ["**/*.ts"]
15+
}
1816
}

apps/roam/eslint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { config } from "@repo/eslint-config/react-internal";
2+
3+
// console.log(config.map((x)=>(x.languageOptions || {}).parserOptions));
4+
5+
export default [
6+
...config,
7+
{
8+
languageOptions: {
9+
parserOptions: {
10+
tsconfigRootDir: ".",
11+
project: true,
12+
ecmaFeatures: {
13+
jsx: true,
14+
},
15+
},
16+
},
17+
},
18+
];

apps/roam/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"dev": "tsx scripts/dev.ts",
88
"build": "tsx scripts/build.ts",
99
"deploy": "tsx scripts/deploy.ts",
10+
"lint": "eslint .",
11+
"lint:fix": "eslint . --fix",
1012
"publish": "tsx scripts/publish.ts"
1113
},
1214
"license": "Apache-2.0",

apps/roam/tsconfig.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
{
2-
"include": ["src", "src/types.d.ts", "tailwind.config.ts", "tests"],
3-
"exclude": ["node_modules"],
42
"extends": "@repo/typescript-config/react-library.json",
3+
"include": ["src", "src/types.d.ts", "tailwind.config.ts", "tests", "scripts"],
54
"compilerOptions": {
65
"baseUrl": ".",
76
"outDir": "dist",
8-
"target": "ESNext",
9-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
107
"allowJs": false,
118
"esModuleInterop": false,
12-
"module": "ESNext",
13-
"moduleResolution": "Node",
149
"forceConsistentCasingInFileNames": true,
1510
"jsx": "react",
1611
"noUncheckedIndexedAccess": false

apps/website/.eslintrc.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

apps/website/eslint.config.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { nextJsConfig } from "@repo/eslint-config/next-js";
2+
3+
export default [
4+
...nextJsConfig,
5+
// additions
6+
{
7+
languageOptions: {
8+
parserOptions: {
9+
tsconfigRootDir: ".",
10+
project: true,
11+
ecmaFeatures: {
12+
jsx: true,
13+
},
14+
},
15+
},
16+
},
17+
{
18+
ignores: [".next/**"],
19+
},
20+
];
File renamed without changes.

0 commit comments

Comments
 (0)