Skip to content

Commit 7e6f680

Browse files
committed
#10 Adding antfu's configs and tweaking them a little.
1 parent 0ca496e commit 7e6f680

File tree

11 files changed

+2124
-527
lines changed

11 files changed

+2124
-527
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Most notably, it doesn't allow for switching Vue versions nor it displays the co
1212

1313
### As part of [amoxtli-vue](https://github.com/ackzell/amoxtli-vue)
1414

15-
This is the playground that will load into a preview pane in the `amoxtli-vue` project.
15+
This is the playground that will load into a preview pane in the `amoxtli-vue` project.
1616
It reads the different [code files in the lessons](https://tutorialkit.dev/guides/creating-content/#a-lesson-code) provided from that repo and loads them into the monaco editor to interact with them.
1717

1818
![screenshot](docs/amoxtli-integration.png)

eslint.config.ts

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1-
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
2-
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
3-
import pluginVue from 'eslint-plugin-vue'
4-
import { globalIgnores } from 'eslint/config'
1+
import antfu from '@antfu/eslint-config';
52

6-
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
7-
// import { configureVueProject } from '@vue/eslint-config-typescript'
8-
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
9-
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
10-
11-
export default defineConfigWithVueTs(
12-
{
13-
name: 'app/files-to-lint',
14-
files: ['**/*.{ts,mts,tsx,vue}'],
3+
export default antfu({
4+
type: 'lib',
5+
stylistic: {
6+
indent: 2,
7+
quotes: 'single',
8+
semi: true,
159
},
10+
typescript: true,
11+
vue: true,
12+
jsonc: false,
13+
yaml: false,
14+
ignores: [
15+
'**/fixtures',
16+
],
17+
}, {
18+
// Additional config for more specific rules
19+
files: ['**/*.vue', '**/*.ts', '**/*.tsx', '**/*.js'],
20+
rules: {
21+
// TypeScript unused vars with underscore ignore pattern
22+
'@typescript-eslint/no-unused-vars': [
23+
'error',
24+
{
25+
argsIgnorePattern: '^_',
26+
varsIgnorePattern: '^_',
27+
},
28+
],
1629

17-
globalIgnores(['**/public/**', '**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
30+
// Vue template formatting
31+
'vue/max-attributes-per-line': [
32+
'warn', // Use 'warn' instead of 'error' for less strict enforcement
33+
{
34+
singleline: 3,
35+
multiline: 2,
36+
},
37+
],
38+
'vue/first-attribute-linebreak': ['warn', {
39+
singleline: 'ignore',
40+
multiline: 'below',
41+
}],
42+
'vue/html-closing-bracket-newline': ['warn', {
43+
singleline: 'never',
44+
multiline: 'always',
45+
}],
1846

19-
pluginVue.configs['flat/essential'],
20-
vueTsConfigs.recommended,
21-
skipFormatting,
22-
)
47+
'vue/custom-event-name-casing': ['error', 'kebab-case'],
48+
'node/prefer-global/process': ['warn'],
49+
'no-console': ['warn'],
50+
},
51+
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"vue": "^3.5.18"
2626
},
2727
"devDependencies": {
28+
"@antfu/eslint-config": "^5.2.1",
2829
"@tsconfig/node22": "^22.0.2",
2930
"@types/node": "^22.16.5",
3031
"@vitejs/plugin-vue": "^6.0.1",

0 commit comments

Comments
 (0)