51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
module.exports = {
|
|
root: true,
|
|
env: {
|
|
node: true,
|
|
browser: true,
|
|
es2021: true
|
|
},
|
|
extends: [
|
|
'plugin:vue/vue3-essential',
|
|
'eslint:recommended',
|
|
'@vue/typescript/recommended',
|
|
'@vue/prettier'
|
|
],
|
|
parser: 'vue-eslint-parser',
|
|
parserOptions: {
|
|
parser: '@typescript-eslint/parser',
|
|
ecmaVersion: 2021,
|
|
sourceType: 'module'
|
|
},
|
|
plugins: ['@typescript-eslint'],
|
|
rules: {
|
|
// Vue規則
|
|
'vue/multi-word-component-names': 'off',
|
|
'vue/no-unused-vars': 'error',
|
|
'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
|
|
// TypeScript規則
|
|
'@typescript-eslint/no-unused-vars': ['error', {
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_'
|
|
}],
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
|
|
// 一般規則
|
|
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
'object-shorthand': 'error',
|
|
'prefer-template': 'error'
|
|
},
|
|
globals: {
|
|
defineProps: 'readonly',
|
|
defineEmits: 'readonly',
|
|
defineExpose: 'readonly',
|
|
withDefaults: 'readonly'
|
|
}
|
|
} |