Skip to content

Commit d6ce1ea

Browse files
committed
chore: switch to eslint flat config
1 parent c45bd22 commit d6ce1ea

6 files changed

+90
-59
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.cjs

-45
This file was deleted.

eslint.config.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import eslint from '@eslint/js'
2+
import tseslint from 'typescript-eslint'
3+
import pluginVue from 'eslint-plugin-vue'
4+
5+
export default tseslint.config(
6+
{ ignores: ['**/node_modules', '**/dist'] },
7+
eslint.configs.recommended,
8+
tseslint.configs.base,
9+
...pluginVue.configs['flat/recommended'],
10+
{
11+
files: ['**/*.vue'],
12+
languageOptions: {
13+
parserOptions: {
14+
parser: '@typescript-eslint/parser',
15+
},
16+
},
17+
},
18+
{
19+
rules: {
20+
'no-debugger': 'error',
21+
'no-console': ['error', { allow: ['warn', 'error', 'info', 'clear'] }],
22+
'no-unused-vars': 'off',
23+
'no-undef': 'off',
24+
'prefer-const': 'error',
25+
'sort-imports': ['error', { ignoreDeclarationSort: true }],
26+
'no-duplicate-imports': 'error',
27+
// This rule enforces the preference for using '@ts-expect-error' comments in TypeScript
28+
// code to indicate intentional type errors, improving code clarity and maintainability.
29+
'@typescript-eslint/prefer-ts-expect-error': 'error',
30+
// Enforce the use of 'import type' for importing types
31+
'@typescript-eslint/consistent-type-imports': [
32+
'error',
33+
{
34+
fixStyle: 'inline-type-imports',
35+
disallowTypeAnnotations: false,
36+
},
37+
],
38+
// Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers
39+
'@typescript-eslint/no-import-type-side-effects': 'error',
40+
'vue/max-attributes-per-line': 'off',
41+
'vue/singleline-html-element-content-newline': 'off',
42+
'vue/multi-word-component-names': 'off',
43+
'vue/html-self-closing': [
44+
'error',
45+
{
46+
html: { component: 'always', normal: 'always', void: 'any' },
47+
math: 'always',
48+
svg: 'always',
49+
},
50+
],
51+
},
52+
},
53+
)

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"build": "vite build",
4747
"build-preview": "vite build -c vite.preview.config.ts",
4848
"format": "prettier --write .",
49-
"lint": "eslint --ext .ts,.vue .",
49+
"lint": "eslint .",
5050
"typecheck": "vue-tsc --noEmit",
5151
"release": "bumpp --all",
5252
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
@@ -73,13 +73,13 @@
7373
"devDependencies": {
7474
"@babel/standalone": "^7.24.7",
7575
"@babel/types": "^7.24.7",
76+
"@eslint/js": "^9.6.0",
7677
"@rollup/plugin-replace": "^5.0.7",
7778
"@shikijs/monaco": "^1.10.0",
7879
"@types/babel__standalone": "^7.1.7",
7980
"@types/codemirror": "^5.60.15",
8081
"@types/hash-sum": "^1.0.2",
8182
"@types/node": "^20.14.9",
82-
"@typescript-eslint/eslint-plugin": "^7.15.0",
8383
"@vitejs/plugin-vue": "^5.0.5",
8484
"@volar/jsdelivr": "~2.4.0-alpha.12",
8585
"@volar/monaco": "~2.4.0-alpha.12",
@@ -90,7 +90,7 @@
9090
"codemirror": "^5.65.16",
9191
"conventional-changelog-cli": "^5.0.0",
9292
"eslint": "^9.6.0",
93-
"eslint-plugin-vue": "^9.26.0",
93+
"eslint-plugin-vue": "^9.27.0",
9494
"fflate": "^0.8.2",
9595
"hash-sum": "^2.0.0",
9696
"lint-staged": "^15.2.7",
@@ -100,6 +100,7 @@
100100
"simple-git-hooks": "^2.11.1",
101101
"sucrase": "^3.35.0",
102102
"typescript": "^5.5.3",
103+
"typescript-eslint": "^7.15.0",
103104
"vite": "^5.3.2",
104105
"vite-plugin-dts": "^3.9.1",
105106
"vscode-uri": "^3.0.8",

pnpm-lock.yaml

+32-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SplitPane.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function changeViewSize() {
9191
class="right"
9292
:style="{ [isVertical ? 'height' : 'width']: 100 - boundSplit + '%' }"
9393
>
94-
<div class="view-size" v-show="state.dragging">
94+
<div v-show="state.dragging" class="view-size">
9595
{{ `${state.viewWidth}px x ${state.viewHeight}px` }}
9696
</div>
9797
<slot name="right" />

0 commit comments

Comments
 (0)