- Install ESLint 9 with flat config, TypeScript, Vue plugins - Configure Prettier (140 char, 2-space indent, single quotes) - Add pre-commit hooks via husky + lint-staged for auto-fix - Rename components to multi-word (Countdown → CountdownTimer, etc.) - Add explicit TypeScript prop/emit interfaces - Remove all console.log statements - Fix all ESLint violations and type errors - Verify type-check, build, and HMR working resolves #43 Co-authored-by: johba <johba@harb.eth> Reviewed-on: https://codeberg.org/johba/harb/pulls/50
56 lines
1.7 KiB
JavaScript
56 lines
1.7 KiB
JavaScript
import pluginVue from 'eslint-plugin-vue';
|
|
import vueTsEslintConfig from '@vue/eslint-config-typescript';
|
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
|
|
export default [
|
|
{
|
|
name: 'app/files-to-lint',
|
|
files: ['**/*.{ts,mts,tsx,vue}'],
|
|
},
|
|
{
|
|
name: 'app/files-to-ignore',
|
|
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/.vite/**', '**/.ponder/**', '**/node_modules/**'],
|
|
},
|
|
...pluginVue.configs['flat/essential'],
|
|
...vueTsEslintConfig(),
|
|
{
|
|
name: 'app/custom-rules',
|
|
rules: {
|
|
// TypeScript rules
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
|
|
// Vue rules
|
|
'vue/multi-word-component-names': 'error',
|
|
'vue/no-unused-vars': 'error',
|
|
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
'vue/require-default-prop': 'error',
|
|
'vue/require-prop-types': 'error',
|
|
'vue/html-indent': ['error', 2],
|
|
'vue/max-attributes-per-line': 'off', // Prettier handles this
|
|
'vue/singleline-html-element-content-newline': 'off', // Prettier handles this
|
|
|
|
// General rules
|
|
'no-console': 'error',
|
|
'max-len': ['error', { code: 140, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true }],
|
|
indent: ['error', 2, { SwitchCase: 1 }],
|
|
|
|
// Disable complexity rules
|
|
complexity: 'off',
|
|
'max-depth': 'off',
|
|
'max-nested-callbacks': 'off',
|
|
'max-lines': 'off',
|
|
'max-lines-per-function': 'off',
|
|
'max-params': 'off',
|
|
'max-statements': 'off',
|
|
},
|
|
},
|
|
eslintConfigPrettier,
|
|
];
|