-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add eslint & extract types
- Loading branch information
Showing
30 changed files
with
885 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// @ts-check | ||
|
||
module.exports = { | ||
root: true, | ||
parser: 'vue-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
extends: ['plugin:vue/vue3-recommended'], | ||
rules: { | ||
'no-debugger': 'error', | ||
'no-console': ['error', { allow: ['warn', 'error', 'info', 'clear'] }], | ||
'sort-imports': ['error', { ignoreDeclarationSort: true }], | ||
|
||
// This rule enforces the preference for using '@ts-expect-error' comments in TypeScript | ||
// code to indicate intentional type errors, improving code clarity and maintainability. | ||
'@typescript-eslint/prefer-ts-expect-error': 'error', | ||
// Enforce the use of 'import type' for importing types | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'error', | ||
{ | ||
fixStyle: 'inline-type-imports', | ||
disallowTypeAnnotations: false, | ||
}, | ||
], | ||
// Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers | ||
'@typescript-eslint/no-import-type-side-effects': 'error', | ||
|
||
'vue/max-attributes-per-line': 'off', | ||
'vue/singleline-html-element-content-newline': 'off', | ||
'vue/multi-word-component-names': 'off', | ||
'vue/html-self-closing': [ | ||
'error', | ||
{ | ||
html: { component: 'always', normal: 'always', void: 'any' }, | ||
math: 'always', | ||
svg: 'always', | ||
}, | ||
], | ||
}, | ||
overrides: [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.