Skip to content

Commit

Permalink
upgrade to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKyun committed Sep 24, 2024
1 parent 6589e63 commit ce25503
Show file tree
Hide file tree
Showing 18 changed files with 367 additions and 1,170 deletions.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

105 changes: 0 additions & 105 deletions .eslintrc.js

This file was deleted.

111 changes: 111 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import globals from 'globals'
import eslintConfigPrettier from 'eslint-config-prettier'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import vueParser from 'vue-eslint-parser'

export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
eslintConfigPrettier,
{
files: ['src/**/*.{js,mjs,cjs,ts,vue,jsx,tsx}'],
ignores: ['**/*.config.js', '**/*.config.ts', 'components.d.ts'],
languageOptions: {
globals: { ...globals.browser, ...globals.node },
parser: vueParser,
parserOptions: {
ecmaVersion: 'latest',
parser: tseslint.parser,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
}
},
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error',
'prettier/prettier': [
'error',
{
// endOfLine: "auto"
}
],
'max-len': [
'error',
{
code: 100,
tabWidth: 2,
comments: 100,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: false
}
],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'no-undef': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'import/no-named-as-default-member': 'off',
'vue/script-setup-uses-vars': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'space-before-function-paren': 'off',
'vue/multi-word-component-names': 'off',
'vue/max-len': [
'error',
{
code: 100,
template: 100,
tabWidth: 2,
comments: 100,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: false,
ignoreHTMLAttributeValues: false,
ignoreHTMLTextContents: false
}
],
'vue/v-on-event-hyphenation': [
'warn',
'always',
{
autofix: true,
ignore: []
}
],
'vue/component-name-in-template-casing': [
'warn',
'kebab-case',
{
registeredComponentsOnly: false,
ignores: []
}
]
}
},
eslintPluginPrettierRecommended
]
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dev": "vite",
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
"preview": "vite preview",
"prepare": "husky install",
"lint:eslint": "eslint --max-warnings 0 \"{src}/**/*.{js,vue,ts,tsx}\" --fix",
"prepare": "husky",
"lint:eslint": "eslint --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged --no-stash"
Expand All @@ -29,14 +29,14 @@
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.4",
"@eslint/js": "^9.11.0",
"@types/color": "^3.0.6",
"@types/element-resize-detector": "^1.1.6",
"@types/eslint__js": "^8.42.3",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.4.1",
"@types/qs": "^6.9.15",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^8.7.0",
"@vicons/antd": "^0.12.0",
"@vicons/carbon": "^0.12.0",
"@vicons/fa": "^0.12.0",
Expand All @@ -46,19 +46,16 @@
"@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/compiler-sfc": "^3.4.38",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/shared": "^3.4.38",
"autoprefixer": "^10.4.20",
"core-js": "^3.38.0",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"eslint": "^9.9.0",
"eslint": "^9.11.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.27.0",
"eslint-plugin-vue": "^9.28.0",
"globals": "^15.9.0",
"husky": "^9.1.4",
"lint-staged": "^15.2.9",
"naive-ui": "^2.39.0",
Expand All @@ -69,16 +66,17 @@
"rollup": "^4.21.0",
"sass": "^1.77.8",
"stylelint": "^16.8.2",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recommended": "^14.0.1",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-order": "^6.0.4",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4",
"typescript-eslint": "^8.6.0",
"unplugin-vue-components": "^0.27.4",
"vfonts": "^0.1.0",
"vite": "^5.4.1",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-html": "^3.2.2",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^2.0.29"
Expand Down
Loading

0 comments on commit ce25503

Please sign in to comment.