Skip to content

Commit 2379289

Browse files
committed
uses @nette/eslint-plugin
1 parent 4a4e5dd commit 2379289

File tree

3 files changed

+30
-53
lines changed

3 files changed

+30
-53
lines changed

eslint.config.js

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,32 @@
11
import globals from 'globals';
2-
import pluginJs from '@eslint/js';
3-
import stylistic from '@stylistic/eslint-plugin';
4-
import tseslint from 'typescript-eslint';
2+
import nette from '@nette/eslint-plugin/typescript';
3+
import { defineConfig } from 'eslint/config';
54

6-
export default [
5+
export default defineConfig([
76
{
87
ignores: [
9-
'*/', '!src/', '!tests/',
10-
'**/netteForms*.*',
8+
'vendor', 'temp',
119
],
1210
},
1311

14-
pluginJs.configs.recommended,
15-
...tseslint.configs.recommended,
16-
17-
stylistic.configs.customize({
18-
indent: 'tab',
19-
braceStyle: '1tbs',
20-
arrowParens: true,
21-
semi: true,
22-
jsx: false,
23-
}),
24-
2512
{
13+
files: [
14+
'*.ts',
15+
'src/assets/*.ts',
16+
],
17+
2618
languageOptions: {
27-
ecmaVersion: 'latest',
2819
globals: {
29-
...globals.browser,
3020
...globals.jasmine,
3121
...globals.amd,
3222
...globals.commonjs,
3323
Nette: 'readable',
3424
Tracy: 'writeable',
3525
},
3626
},
37-
plugins: {
38-
'@stylistic': stylistic,
39-
},
40-
rules: {
41-
'@stylistic/no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0 }],
42-
'@stylistic/new-parens': ['error', 'never'],
43-
'@stylistic/padded-blocks': 'off',
44-
'@typescript-eslint/no-explicit-any': 'off',
45-
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
46-
'prefer-arrow-callback': 'error',
47-
'arrow-body-style': 'error',
48-
'eqeqeq': ['error', 'always', { null: 'ignore' }],
49-
'no-var': 'error',
50-
'prefer-const': 'off',
51-
'curly': 'error',
52-
},
27+
28+
extends: [
29+
nette.configs.typescript,
30+
],
5331
},
54-
];
32+
]);

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
{
22
"type": "module",
33
"devDependencies": {
4-
"@eslint/js": "^9.8.0",
4+
"@nette/eslint-plugin": "^0.1.2",
55
"@rollup/plugin-json": "^6.1.0",
6-
"@rollup/plugin-node-resolve": "^15.2.3",
6+
"@rollup/plugin-node-resolve": "^16.0.1",
77
"@rollup/plugin-terser": "^0.4.4",
8-
"@rollup/plugin-typescript": "^11.1.6",
9-
"@stylistic/eslint-plugin": "^2.1.0",
10-
"eslint": "^9.8.0",
8+
"@rollup/plugin-typescript": "^12.1.2",
9+
"eslint": "^9.26.0",
1110
"globals": "^15.3.0",
12-
"jasmine": "^5.1.0",
13-
"jasmine-core": "^5.1.1",
14-
"karma": "^6.4.2",
11+
"jasmine": "^5.7.1",
12+
"jasmine-core": "^5.7.1",
13+
"karma": "^6.4.4",
1514
"karma-chrome-launcher": "^3.2.0",
1615
"karma-jasmine": "^5.1.0",
17-
"rollup": "^4.18.0",
18-
"rollup-plugin-dts": "^6.1.1",
19-
"terser": "^5.31.0",
20-
"typescript": "^5.5.4",
21-
"typescript-eslint": "^8.0.0"
16+
"rollup": "^4.40.2",
17+
"rollup-plugin-dts": "^6.2.1",
18+
"terser": "^5.39.1",
19+
"typescript": "^5.8.3",
20+
"typescript-eslint": "^8.32.1"
2221
},
2322
"scripts": {
2423
"typecheck": "tsc -noemit",
25-
"lint": "eslint",
26-
"lint:fix": "eslint --fix",
24+
"lint": "eslint --cache",
25+
"lint:fix": "eslint --cache --fix",
2726
"test": "karma start tests/netteForms/karma.conf.ts",
2827
"build": "rollup -c",
2928
"postbuild": "npm run test"

src/assets/formValidator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export class FormValidator {
4949
} else if (elem.type === 'checkbox') {
5050
return elem.name.endsWith('[]') // checkbox list
5151
? this.#expandRadioElement(elem)
52-
.filter((input) => input.checked)
53-
.map((input) => input.value)
52+
.filter((input) => input.checked)
53+
.map((input) => input.value)
5454
: elem.checked;
5555

5656
} else {

0 commit comments

Comments
 (0)