Skip to content

Commit

Permalink
setup(all): update tsconfigs to run eslint on all files including not…
Browse files Browse the repository at this point in the history
… src
  • Loading branch information
NexZhu committed Dec 20, 2023
1 parent 0762a43 commit 34ed1c5
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 39 deletions.
14 changes: 3 additions & 11 deletions apps/desktop/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ export default config(
{
languageOptions: {
parserOptions: {
project: ['tsconfig.build.json'],
}
}
},
{
files: ["**/*.spec.ts"],
languageOptions: {
parserOptions: {
project: ['tsconfig.spec.json'],
}
}
project: ['tsconfig.root.json', 'tsconfig.src.json', 'tsconfig.spec.json'],
},
},
},
)
11 changes: 7 additions & 4 deletions apps/desktop/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
"compilerOptions": {
"baseUrl": "."
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.build.json"
"path": "./tsconfig.root.json"
},
{
"path": "./tsconfig.src.json"
},
{
"path": "./tsconfig.spec.json"
}
]
],
"files": [],
"include": []
}
21 changes: 21 additions & 0 deletions apps/desktop/tsconfig.root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true
},
"include": [".*.cjs", "**/*.ts", "**/*.cts", "**/*.tsx", "**/*.js", "**/*.cjs", "**/*.jsx", "**/*.vue"],
"exclude": [
"src/**/*",
"vite.config.ts",
"vitest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"types": ["node"]
"types": ["node"],
"declaration": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
Expand Down
14 changes: 3 additions & 11 deletions apps/web/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ export default config(
{
languageOptions: {
parserOptions: {
project: ['tsconfig.build.json'],
}
}
},
{
files: ["**/*.spec.ts"],
languageOptions: {
parserOptions: {
project: ['tsconfig.spec.json'],
}
}
project: ['tsconfig.root.json', 'tsconfig.src.json', 'tsconfig.spec.json'],
},
},
},
)
11 changes: 7 additions & 4 deletions apps/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
"compilerOptions": {
"baseUrl": "."
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.build.json"
"path": "./tsconfig.root.json"
},
{
"path": "./tsconfig.src.json"
},
{
"path": "./tsconfig.spec.json"
}
]
],
"files": [],
"include": []
}
21 changes: 21 additions & 0 deletions apps/web/tsconfig.root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true
},
"include": [".*.cjs", "**/*.ts", "**/*.cts", "**/*.tsx", "**/*.js", "**/*.cjs", "**/*.jsx", "**/*.vue"],
"exclude": [
"src/**/*",
"vite.config.ts",
"vitest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"types": ["node"]
"types": ["node"],
"declaration": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
Expand Down
5 changes: 4 additions & 1 deletion libs/myutil/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"include": [],
"references": [
{
"path": "./tsconfig.build.json"
"path": "./tsconfig.root.json"
},
{
"path": "./tsconfig.src.json"
},
{
"path": "./tsconfig.spec.json"
Expand Down
21 changes: 21 additions & 0 deletions libs/myutil/tsconfig.root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true
},
"include": [".*.cjs", "**/*.ts", "**/*.cts", "**/*.tsx", "**/*.js", "**/*.cjs", "**/*.jsx","**/*.vue"],
"exclude": [
"src/**/*",
"vite.config.ts",
"vitest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
"src/**/*.spec.tsx",
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
],
}
File renamed without changes.
4 changes: 2 additions & 2 deletions nx.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const config = {
options: {
clean: false,
main: '{projectRoot}/src/index.ts',
tsConfig: '{projectRoot}/tsconfig.build.json',
tsConfig: '{projectRoot}/tsconfig.src.json',
},
configurations: {
ci: {
Expand Down Expand Up @@ -111,7 +111,7 @@ const config = {
executor: 'nx:run-commands',
options: {
cwd: '{projectRoot}',
command: 'FIX={args.fix}; eslint src --fix=${FIX:-false}',
command: 'FIX={args.fix}; eslint . --fix=${FIX:-false}',
},
},
stylelint: {
Expand Down
4 changes: 2 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"options": {
"clean": false,
"main": "{projectRoot}/src/index.ts",
"tsConfig": "{projectRoot}/tsconfig.build.json"
"tsConfig": "{projectRoot}/tsconfig.src.json"
},
"configurations": {
"ci": {
Expand Down Expand Up @@ -164,4 +164,4 @@
]
}
}
}
}

0 comments on commit 34ed1c5

Please sign in to comment.