Skip to content

Commit

Permalink
Merge pull request #650 from 0xJacky/chore/eslint9
Browse files Browse the repository at this point in the history
chore: migrate to ESlint v9
  • Loading branch information
0xJacky authored Oct 24, 2024
2 parents 01847fe + 18b36e6 commit 25d60d5
Show file tree
Hide file tree
Showing 142 changed files with 6,402 additions and 4,067 deletions.
Empty file modified .editorconfig
100755 → 100644
Empty file.
10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

257 changes: 0 additions & 257 deletions app/.eslintrc.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion app/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare module '*.svg' {
import React from 'react'
import type React from 'react'

const content: React.FC<React.SVGProps<SVGElement>>
export default content
}
52 changes: 52 additions & 0 deletions app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import createConfig from '@antfu/eslint-config'
import sonarjs from 'eslint-plugin-sonarjs'

export default createConfig(
{
stylistic: true,
ignores: ['**/version.json', 'tsconfig.json', 'tsconfig.node.json'],
},
sonarjs.configs.recommended,
{
name: '@nginx-ui/eslint-config',
rules: {
'no-console': 'warn',
'no-alert': 'warn',
'ts/no-explicit-any': 'warn',
'vue/no-unused-refs': 'warn',
'vue/prop-name-casing': 'warn',
'node/prefer-global/process': 'off',
'unused-imports/no-unused-vars': 'warn',

// https://eslint.org/docs/latest/rules/dot-notation
'style/dot-notation': 'off',

// https://eslint.org/docs/latest/rules/arrow-parens
'style/arrow-parens': ['error', 'as-needed'],

// https://eslint.org/docs/latest/rules/prefer-template
'prefer-template': 'error',

// https://eslint.style/rules/js/arrow-spacing
'style/arrow-spacing': ['error', { before: true, after: true }],

// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md
'import/prefer-default-export': 'off',

// https://eslint.vuejs.org/rules/require-typed-ref
'vue/require-typed-ref': 'warn',

// https://eslint.vuejs.org/rules/require-prop-types
'vue/require-prop-types': 'warn',

// https://eslint.vuejs.org/rules/no-ref-as-operand.html
'vue/no-ref-as-operand': 'error',

// -- Sonarlint
'sonarjs/no-duplicate-string': 'off',
'sonarjs/no-nested-template-literals': 'off',
'sonarjs/pseudo-random': 'warn',
'sonarjs/no-nested-functions': 'off',
},
},
)
1 change: 0 additions & 1 deletion app/gettext.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const i18n = require('./i18n.json')

module.exports = {
Expand Down
Loading

0 comments on commit 25d60d5

Please sign in to comment.