Skip to content

Commit d46b135

Browse files
chore: update legacy eslint config for tests and caught errors
1 parent da98e99 commit d46b135

4 files changed

Lines changed: 61 additions & 58 deletions

File tree

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
.test-reports
4+
.coverage
5+
.nostr

.eslintrc.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
sourceType: 'module',
5+
},
6+
plugins: ['@typescript-eslint'],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8+
root: true,
9+
env: {
10+
node: true,
11+
},
12+
ignorePatterns: ['dist', 'tslint.json', 'node_modules'],
13+
rules: {
14+
'@typescript-eslint/no-explicit-any': 'off',
15+
'@typescript-eslint/no-unused-vars': [
16+
'error',
17+
{
18+
argsIgnorePattern: '^_',
19+
caughtErrors: 'none',
20+
},
21+
],
22+
'@typescript-eslint/no-require-imports': 'off',
23+
24+
semi: ['error', 'never'],
25+
quotes: ['error', 'single', { avoidEscape: true }],
26+
'sort-imports': [
27+
'error',
28+
{
29+
ignoreCase: true,
30+
allowSeparatedGroups: true,
31+
},
32+
],
33+
curly: [2, 'multi-line'],
34+
'max-len': [
35+
'error',
36+
{
37+
code: 120,
38+
ignoreStrings: true,
39+
ignoreTemplateLiterals: true,
40+
ignoreRegExpLiterals: true,
41+
},
42+
],
43+
'comma-dangle': ['error', 'always-multiline'],
44+
},
45+
overrides: [
46+
{
47+
files: ['test/**/*.ts', '**/*.spec.ts'],
48+
rules: {
49+
'@typescript-eslint/no-unused-expressions': 'off',
50+
},
51+
},
52+
],
53+
}

eslint.config.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
"prestart": "npm run build",
2929
"start": "cd dist && node src/index.js",
3030
"build:check": "npm run build -- --noEmit",
31-
"lint": "eslint ./src ./test",
32-
"lint:report": "eslint -o .lint-reports/eslint.json -f json ./src ./test",
31+
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint --ext .ts ./src ./test",
32+
"lint:report": "ESLINT_USE_FLAT_CONFIG=false eslint -o .lint-reports/eslint.json -f json --ext .ts ./src ./test",
33+
"lint:fix": "npm run lint -- --fix",
3334
"knip": "knip --config .knip.json --production --no-progress --reporter compact",
3435
"check:all": "npm run lint && npm run knip",
35-
"lint:fix": "npm run lint -- --fix",
3636
"import": "node -r ts-node/register src/import-events.ts",
3737
"db:migrate": "knex migrate:latest",
3838
"db:migrate:rollback": "knex migrate:rollback",

0 commit comments

Comments
 (0)