Skip to content

Commit 282028c

Browse files
Modernize ESLint configuration and fix formatting
1 parent c2026b4 commit 282028c

3 files changed

Lines changed: 30 additions & 27 deletions

File tree

eslint.config.mjs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import js from '@eslint/js';
2-
import tsEslint from 'typescript-eslint';
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
33

4-
export default [
5-
js.configs.recommended,
6-
...tsEslint.configs.recommended,
7-
{
8-
ignores: [
9-
"dist/",
10-
"dist-esm/",
11-
"docs/",
12-
"tests/",
13-
"node_modules/"
14-
]
15-
},
16-
{
17-
files: ["**/*.ts"],
18-
rules: {
19-
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
20-
"@typescript-eslint/no-explicit-any": "off"
21-
}
22-
}
23-
];
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
...tseslint.configs.recommended,
7+
{
8+
rules: {
9+
"semi": ["warn", "always"],
10+
"indent": ["warn", "tab", { "SwitchCase": 1 }],
11+
"@typescript-eslint/no-explicit-any": "off"
12+
},
13+
files: ['src/**/*.ts'],
14+
languageOptions: {
15+
ecmaVersion: 2022,
16+
sourceType: 'module',
17+
globals: {
18+
console: 'readonly',
19+
process: 'readonly'
20+
}
21+
}
22+
}
23+
);

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
"get-func-name@<2.0.1": ">=2.0.1",
8585
"@babel/traverse@<7.23.2": ">=7.23.2",
8686
"braces@<3.0.3": ">=3.0.3"
87-
}
87+
},
88+
"ignoredBuiltDependencies": [
89+
"esbuild"
90+
]
8891
}
8992
}

src/Regex.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ export class Regex
6565
typeof options==='string'
6666
? (options + extra.join(EMPTY)).toLowerCase()
6767
: ((options && (options instanceof Array
68-
? options
69-
: [options]).concat(extra)) || extra)
70-
.join(EMPTY)
71-
.toLowerCase();
68+
? options
69+
: [options]).concat(extra)) || extra)
70+
.join(EMPTY)
71+
.toLowerCase();
7272

7373
if(pattern instanceof RegExp)
7474
{

0 commit comments

Comments
 (0)