feat: extend ESLint config with default rule set
PR Check / Dependency audit (pull_request) Successful in 6s
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / AI code review (opencode) (pull_request) Successful in 8s
PR Check / ESLint (pull_request) Failing after 7s
PR Check / Typecheck (pull_request) Failing after 6s
PR Check / Secret scan (gitleaks) (pull_request) Failing after 1s
PR Check / Security scan (Snyk) (pull_request) Failing after 1s
PR Check / Dependency audit (pull_request) Successful in 6s
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / AI code review (opencode) (pull_request) Successful in 8s
PR Check / ESLint (pull_request) Failing after 7s
PR Check / Typecheck (pull_request) Failing after 6s
PR Check / Secret scan (gitleaks) (pull_request) Failing after 1s
PR Check / Security scan (Snyk) (pull_request) Failing after 1s
- ignore generated code (.nuxt, .output, dist) - no-console/no-debugger warnings in production - enforce eqeqeq, prefer-const, no-var - Vue conventions: PascalCase templates, script-template-style order, true attribute shorthand, warn on v-html (XSS) - disable no-undef in favour of TypeScript
This commit is contained in:
1 parent
1d9da87986
commit
e4ea5c3e7c
1 file changed
+30
-4
+30
-4
@@ -1,8 +1,34 @@
|
||||
import { withNuxt } from './.nuxt/eslint.config.mjs'
|
||||
|
||||
export default withNuxt({
|
||||
// Your custom ESLint rules go here, e.g.:
|
||||
// rules: {
|
||||
// 'no-console': 'warn',
|
||||
// },
|
||||
// Files ESLint should never look at (generated code & build output)
|
||||
ignores: [
|
||||
'.nuxt/**',
|
||||
'.output/**',
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
'.data/**',
|
||||
],
|
||||
|
||||
rules: {
|
||||
// ---------- general ----------
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
eqeqeq: ['error', 'always'],
|
||||
'prefer-const': 'error',
|
||||
'no-var': 'error',
|
||||
'object-shorthand': ['warn', 'always'],
|
||||
|
||||
// ---------- vue ----------
|
||||
// Keep components consistent and catch template bugs early
|
||||
'vue/multi-word-component-names': 'off', // pages/index.vue etc. are fine
|
||||
'vue/component-name-in-template-casing': ['warn', 'PascalCase'],
|
||||
'vue/no-unused-refs': 'error',
|
||||
'vue/prefer-true-attribute-shorthand': 'warn',
|
||||
'vue/block-order': ['error', { order: ['script', 'template', 'style'] }],
|
||||
'vue/no-v-html': 'warn', // XSS risk unless content is sanitized
|
||||
|
||||
// ---------- typescript-ish (via vue-tsc + nuxt defaults) ----------
|
||||
'no-undef': 'off', // TS handles this; avoids false positives on Nuxt auto-imports
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user