Skip to content

Commit

Permalink
chore: upgrade eslint config (#196)
Browse files Browse the repository at this point in the history
* chore: upgrade eslint config

* chore: update lint:ci script and dependency

* chore: add newline to package.json
  • Loading branch information
erik-slovak authored Dec 13, 2024
1 parent 8f7fc42 commit 59cfd11
Show file tree
Hide file tree
Showing 5 changed files with 984 additions and 817 deletions.
3 changes: 3 additions & 0 deletions eslint-ci-rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"@typescript-eslint/no-magic-numbers"
]
13 changes: 13 additions & 0 deletions eslint-ci.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const ciRules = require('./eslint-ci-rules.json')

module.exports = (async function config() {
const { default: defaultConfigPromise } = await import('./eslint.config.js')
const defaultConfig = await defaultConfigPromise
return [
...defaultConfig,
{
files: ['**/*.ts', '**/*.tsx'],
rules: ciRules.reduce((acc, rule) => ({ ...acc, [rule]: 'warn' }), {}),
},
]
})()
12 changes: 4 additions & 8 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
const txoConfig = require('eslint-config-txo-typescript')

/** @type {import('eslint').Linter.FlatConfig[]} */
const config = [
...txoConfig.default,
]

module.exports = config
module.exports = (async function config() {
const txoPackageConfigList = await import('eslint-config-txo-package-typescript')
return txoPackageConfigList.configList
})()
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"sanity": "yarn lint:ci && yarn build && tsc --noEmit && yarn test --coverage && yarn compare-boilerplate-version && echo 'success'",
"semantic-release": "semantic-release",
"update-boilerplate-version": "./scripts/update-boilerplate-version.sh",
"lint:ci": "yarn lint",
"lint:ci": "yarn eslint -c eslint-ci.config.js --cache . && yarn txo-eslint ccr --cache",
"type-check": "tsc --noEmit"
},
"engines": {
Expand All @@ -50,7 +50,7 @@
"@types/jest": "^29.5.14",
"@types/uuid": "^10.0.0",
"concurrently": "^9.1.0",
"eslint-config-txo-typescript": "^4.0.70",
"eslint-config-txo-package-typescript": "^1.0.7",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^15.2.11",
Expand Down
Loading

0 comments on commit 59cfd11

Please sign in to comment.