Skip to content

Commit 8a4a2bf

Browse files
authored
chore: upgrade eslint config (#1044)
* chore: upgrade eslint config * chore: update lint:ci script and dependency * chore: add newline to package.json
1 parent effa033 commit 8a4a2bf

File tree

5 files changed

+667
-670
lines changed

5 files changed

+667
-670
lines changed

eslint-ci-rules.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
"@typescript-eslint/no-magic-numbers",
3+
"@stylistic/arrow-parens",
4+
"@typescript-eslint/no-import-type-side-effects",
5+
"@typescript-eslint/no-unnecessary-condition",
6+
"@typescript-eslint/no-unsafe-type-assertion",
7+
"eslint-comments/require-description",
8+
"@typescript-eslint/prefer-regexp-exec",
9+
"@stylistic/space-before-function-paren",
10+
"@typescript-eslint/consistent-type-exports"
11+
]

eslint-ci.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const ciRules = require('./eslint-ci-rules.json')
2+
3+
module.exports = (async function config() {
4+
const { default: defaultConfigPromise } = await import('./eslint.config.js')
5+
const defaultConfig = await defaultConfigPromise
6+
return [
7+
...defaultConfig,
8+
{
9+
files: ['**/*.ts', '**/*.tsx'],
10+
rules: ciRules.reduce((acc, rule) => ({ ...acc, [rule]: 'warn' }), {}),
11+
},
12+
]
13+
})()

eslint.config.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
const txoConfig = require('eslint-config-txo-typescript')
2-
3-
/** @type {import('eslint').Linter.FlatConfig[]} */
4-
const config = [
5-
...txoConfig.default,
6-
]
7-
8-
module.exports = config
1+
module.exports = (async function config() {
2+
const txoPackageReactConfigList = await import('eslint-config-txo-package-react')
3+
return txoPackageReactConfigList.configList
4+
})()

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"sanity": "yarn lint:ci && yarn build && tsc --noEmit && yarn test --coverage && yarn compare-boilerplate-version && echo 'success'",
3333
"semantic-release": "semantic-release",
3434
"update-boilerplate-version": "./scripts/update-boilerplate-version.sh",
35-
"lint:ci": "yarn lint",
35+
"lint:ci": "yarn eslint -c eslint-ci.config.js --cache . && yarn txo-eslint ccr --cache",
3636
"type-check": "tsc --noEmit"
3737
},
3838
"engines": {
@@ -70,7 +70,7 @@
7070
"@types/react-dom": "^18.3.5",
7171
"@types/react-native": "^0.73.0",
7272
"concurrently": "^9.1.0",
73-
"eslint-config-txo-typescript-react": "^2.0.82",
73+
"eslint-config-txo-package-react": "^1.0.7",
7474
"graphql": "^16.9.0",
7575
"husky": "^9.1.7",
7676
"jest": "^29.7.0",

0 commit comments

Comments
 (0)