Skip to content

Commit 4f25a0c

Browse files
committed
chore: migrate to ESlint v9
1 parent 8c00292 commit 4f25a0c

File tree

142 files changed

+6401
-4066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+6401
-4066
lines changed

.editorconfig

100755100644
File mode changed.

.idea/inspectionProfiles/Project_Default.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.eslintrc.cjs

-257
This file was deleted.

app/env.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
declare module '*.svg' {
2-
import React from 'react'
2+
import type React from 'react'
3+
34
const content: React.FC<React.SVGProps<SVGElement>>
45
export default content
56
}

app/eslint.config.mjs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import createConfig from '@antfu/eslint-config'
2+
import sonarjs from 'eslint-plugin-sonarjs'
3+
4+
export default createConfig(
5+
{
6+
stylistic: true,
7+
ignores: ['**/version.json', 'tsconfig.json', 'tsconfig.node.json'],
8+
},
9+
sonarjs.configs.recommended,
10+
{
11+
name: '@nginx-ui/eslint-config',
12+
rules: {
13+
'no-console': 'warn',
14+
'no-alert': 'warn',
15+
'ts/no-explicit-any': 'warn',
16+
'vue/no-unused-refs': 'warn',
17+
'vue/prop-name-casing': 'warn',
18+
'node/prefer-global/process': 'off',
19+
'unused-imports/no-unused-vars': 'warn',
20+
21+
// https://eslint.org/docs/latest/rules/dot-notation
22+
'style/dot-notation': 'off',
23+
24+
// https://eslint.org/docs/latest/rules/arrow-parens
25+
'style/arrow-parens': ['error', 'as-needed'],
26+
27+
// https://eslint.org/docs/latest/rules/prefer-template
28+
'prefer-template': 'error',
29+
30+
// https://eslint.style/rules/js/arrow-spacing
31+
'style/arrow-spacing': ['error', { before: true, after: true }],
32+
33+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md
34+
'import/prefer-default-export': 'off',
35+
36+
// https://eslint.vuejs.org/rules/require-typed-ref
37+
'vue/require-typed-ref': 'warn',
38+
39+
// https://eslint.vuejs.org/rules/require-prop-types
40+
'vue/require-prop-types': 'warn',
41+
42+
// https://eslint.vuejs.org/rules/no-ref-as-operand.html
43+
'vue/no-ref-as-operand': 'error',
44+
45+
// -- Sonarlint
46+
'sonarjs/no-duplicate-string': 'off',
47+
'sonarjs/no-nested-template-literals': 'off',
48+
'sonarjs/pseudo-random': 'warn',
49+
'sonarjs/no-nested-functions': 'off',
50+
},
51+
},
52+
)

app/gettext.config.cjs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
21
const i18n = require('./i18n.json')
32

43
module.exports = {

0 commit comments

Comments
 (0)