Skip to content

Commit 1d100d9

Browse files
committed
chore: update eslint setup and sync boilerplate changes
1 parent 9624fd3 commit 1d100d9

18 files changed

+840
-145
lines changed

.boilerplate-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d769f2d57af542dd1ef245dc3594d9e5ac6e31dc

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ on:
66

77
jobs:
88
release:
9-
name: '/'
9+
name: 'Release'
1010
uses: technology-studio/github-workflows/.github/workflows/_release.yml@main
1111
secrets: inherit

.ncurc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dep": "dev,prod,peer"
3+
}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/*
1+
22.13.1

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "Debug Jest Tests",
99
"type": "node",
1010
"request": "launch",
11-
"runtimeArgs": [ "--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand", "--coverage", "false", "${file}" ],
11+
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand", "--coverage", "false", "${file}"],
1212
"console": "integratedTerminal",
1313
"internalConsoleOptions": "neverOpen"
1414
},
@@ -17,8 +17,8 @@
1717
"type": "node",
1818
"request": "launch",
1919
"runtimeExecutable": "yarn",
20-
"args": [ "test", "--runInBand", "--coverage=false", "${file}" ],
21-
"runtimeArgs": [ "--inspect-brk" ],
20+
"args": ["test", "--runInBand", "--coverage=false", "${file}"],
21+
"runtimeArgs": ["--inspect-brk"],
2222
"console": "integratedTerminal",
2323
"internalConsoleOptions": "neverOpen"
2424
},

__tests__/Tests/Lint.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import { ESLint } from 'eslint'
99
test('shoud not have lint issues', async () => {
1010
const eslint = new ESLint()
1111
const results = await eslint.lintFiles(['test/**/*.tsx'])
12-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- result should have no errors
1312
const isWithoutError = results.every((result: { errorCount: number }) => result.errorCount === 0)
1413
expect(isWithoutError).toBe(true)
15-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- we want to make the timeout longer
1614
}, 20000)

__tests__/tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4+
"paths": {
5+
"Config/*": [ "./__tests__/Config/*" ],
6+
"Data/*": [ "./__tests__/Data/*" ],
7+
"Utils/*": [ "./__tests__/Utils/*" ],
8+
"src": [ "./src" ],
9+
"src/*": [ "./src/*" ]
10+
}
411
},
512
"include": [
613
"./**/*.ts"

eslint-ci-rules.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

eslint-ci.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import ciRules from './eslint-ci-rules.json' with { type: 'json' }
2+
3+
export default (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: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
2-
typescriptConfigList,
2+
jestConfig,
33
stylisticConfig,
4+
typescriptConfigList,
45
typescriptEslintConfig
56
} from 'eslint-config-txo-typescript'
67
import {
@@ -13,12 +14,23 @@ export default typescriptEslintConfig(
1314
files: ['**/*.ts', '**/*.tsx'],
1415
extends: [
1516
...typescriptConfigList,
17+
// TODO: remove after migrating to prettier
1618
stylisticConfig,
1719
reactConfig,
1820
]
1921
},
22+
{
23+
files: ['__tests__/**/*.ts', '__tests__/**/*.tsx'],
24+
extends: [
25+
jestConfig,
26+
]
27+
},
2028
{
2129
ignores: [
30+
'commitlint.config.js',
31+
'jest.config.js',
32+
'.releaserc.js',
33+
'eslint.config.js',
2234
'coverage',
2335
'lib',
2436
'node_modules',

0 commit comments

Comments
 (0)