Skip to content

Commit

Permalink
Update ESLint and TypeScript configurations for improved compatibilit…
Browse files Browse the repository at this point in the history
…y and performance
  • Loading branch information
1aron committed Nov 26, 2024
1 parent 22e4873 commit 9936589
Show file tree
Hide file tree
Showing 45 changed files with 205 additions and 133 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"eslint.useFlatConfig": true,
"yaml.format.singleQuote": true,
"javascript.format.semicolons": "remove",
"editor.codeActionsOnSave": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
"dependencies": {
"@rollup/plugin-commonjs": "^25.0.8",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-swc": "^0.3.1",
"@rollup/plugin-typescript": "^11.1.6",
"@rollup/pluginutils": "^5.1.3",
"cross-env": "^7.0.3",
"get-tsconfig": "^4.8.1",
"rollup-plugin-swc3": "^0.12.1",
"ts-jest": "^29.2.5"
}
}
3 changes: 0 additions & 3 deletions packages/commitlint-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs"
]
}
2 changes: 1 addition & 1 deletion packages/conventional-changelog-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "conventional-changelog-techor",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "pnpm build && jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/conventional-changelog-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
"./declaration.d.ts"
],
"exclude": [
Expand Down
11 changes: 11 additions & 0 deletions packages/conventional-changelog-config/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts",
"./declaration.d.ts"
]
}
2 changes: 1 addition & 1 deletion packages/conventional-commits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"build:cjs": "esbuild src/index.ts --bundle --outfile=dist/index.js --format=cjs --minify --sourcemap --platform=node --external:esbuild --external:fast-glob --external:require-from-string --external:@techor/extend --external:@techor/fs --external:upath",
"build:esm": "esbuild src/index.ts --bundle --outfile=dist/index.mjs --format=esm --minify --sourcemap --platform=node --external:esbuild --external:fast-glob --external:require-from-string --external:@techor/extend --external:@techor/fs --external:upath",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"type-check": "tsc --noEmit",
Expand Down
3 changes: 0 additions & 3 deletions packages/conventional-commits/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/conventional-commits/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
2 changes: 1 addition & 1 deletion packages/cross-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/cross-import/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/cross-import/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
6 changes: 5 additions & 1 deletion packages/eslint-config/configs/stylistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ module.exports = {
'indent': ['off', 4],
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'semi': ['error', 'never']
}
},
files: [
'**/*.js', '**/*.jsx', '**/*.mjs', '**/*.cjs',
'**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'
],
}
7 changes: 3 additions & 4 deletions packages/eslint-config/configs/typescript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const parser = require('@typescript-eslint/parser')
const tseslint = require('typescript-eslint')
const ts = require('@typescript-eslint/eslint-plugin')

/** @type {import('eslint').Linter.Config} */
Expand All @@ -24,9 +24,8 @@ module.exports = {
'@typescript-eslint': ts,
},
languageOptions: {
parser,
parser: tseslint.parser,
parserOptions: {
projectService: true,
sourceType: 'module'
},
ecmaVersion: 'latest',
Expand All @@ -37,5 +36,5 @@ module.exports = {
jest: true
}
},
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts']
files: [ '**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
}
1 change: 0 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"dependencies": {
"@eslint/js": "",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"typescript-eslint": ""
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/explore-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/explore-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/explore-config/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
2 changes: 1 addition & 1 deletion packages/extend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/extend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/extend/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
2 changes: 1 addition & 1 deletion packages/fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/fs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/fs/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
2 changes: 1 addition & 1 deletion packages/glob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/glob/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/glob/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
2 changes: 1 addition & 1 deletion packages/is-plain-obj/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/is-plain-obj/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/is-plain-obj/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
3 changes: 0 additions & 3 deletions packages/jest-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"url": "https://aron.tw"
},
"homepage": "https://aron.tw",
"scripts": {
"lint": "eslint"
},
"bugs": {
"url": "https://github.com/techor-dev/techor/issues"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/log/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/log/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/log/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
2 changes: 1 addition & 1 deletion packages/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"scripts": {
"build:main": "rollup --config rollup.config.mjs",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput --project tsconfig.prod.json",
"build": "pnpm run \"/^build:.*/\"",
"dev": "pnpm run \"/^build:.*/\" --watch",
"test": "jest",
Expand Down
3 changes: 0 additions & 3 deletions packages/npm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"src/**/*.ts",
"src/**/*.d.ts",
"tests/**/*.ts",
"jest.config.ts",
"eslint.config.mjs",
"rollup.config.mjs",
],
"exclude": [
"src/**/*.test.ts"
Expand Down
10 changes: 10 additions & 0 deletions packages/npm/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": [
"src/**/*.ts"
]
}
Loading

0 comments on commit 9936589

Please sign in to comment.