feat(landing): add strict ESLint + Prettier with pre-commit hooks (#50)
- 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
This commit is contained in:
parent
09c36f2c87
commit
2acb619a11
39 changed files with 3460 additions and 1246 deletions
56
landing/eslint.config.js
Normal file
56
landing/eslint.config.js
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
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,
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue