Skip to content

Commit

Permalink
🚧 .eslintc.json の設定を eslint.config.js に移行
Browse files Browse the repository at this point in the history
npm run lintで1475 errors, 6 warningsになる
  • Loading branch information
reiroop committed Nov 2, 2024
1 parent 6b17ee5 commit 2584177
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 5 deletions.
80 changes: 76 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,89 @@
import pluginJs from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import { default as pluginJs } from '@eslint/js'
import typeScriptESLintParser from '@typescript-eslint/parser'
import importPlugin from 'eslint-plugin-import'
import unusedImports from 'eslint-plugin-unused-imports'
import pluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import tseslint from 'typescript-eslint'

const compat = new FlatCompat()

/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{js,mjs,cjs,ts,vue}'] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
{
files: ['**/*.vue'],
languageOptions: { parserOptions: { parser: tseslint.parser } }
}
plugins: {
import: importPlugin,
'unused-imports': unusedImports
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2021
},
parserOptions: { parser: typeScriptESLintParser }
},
rules: {
'no-console': 'warn',
'no-debugger': 'warn',
'no-empty': ['error', { allowEmptyCatch: true }],
'vue/attributes-order': [
'warn',
{
alphabetical: true
}
],
eqeqeq: 'error',
'vue/eqeqeq': 'error',
'no-restricted-imports': [
'error',
{
paths: ['/@/lib/apis/generated'],
patterns: ['../']
}
],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none'
},
singleline: {
delimiter: 'semi'
}
}
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'vue/require-default-prop': 'off',
'vue/block-lang': [
'error',
{
script: { lang: 'ts' }
}
],
'vue/component-api-style': ['error', ['script-setup']],
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/v-on-event-hyphenation': ['error', 'always', { autofix: true }],
'vue/v-on-function-call': 'error',
'vue/no-template-target-blank': 'error',
'vue/prefer-true-attribute-shorthand': 'error',
'vue/prefer-import-from-vue': 'error',
'import/no-duplicates': 'warn',
'unused-imports/no-unused-imports': 'warn',
'vue/multi-word-component-names': 'warn'
}
},
...compat.extends(
'./eslint-vue-ts-recommended.cjs',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier'
)
]
1 change: 1 addition & 0 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion src/components/requestDetail/RequestTargets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const handleUpdateTargets = async () => {
<RequestTarget
v-for="(target, i) in request.targets"
:key="target.id"
v-model:targetModel="editedTargets[i]"
v-model:target-model="editedTargets[i]"
:is-edit-mode="isEditMode"
:request="request"
:target="target" />
Expand Down

0 comments on commit 2584177

Please sign in to comment.