Skip to content

Commit 678af17

Browse files
authored
refactor(config): restructure eslint configuration and build setup (#27)
1 parent 970c041 commit 678af17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4865
-447
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
node_modules/
22

33
.history/
4+
5+
dist
6+
7+
src/typegen.d.ts
8+
9+
.eslint-config-inspector

README.md

Lines changed: 79 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,89 @@
11
# eslint-config-vuetify
2-
>
3-
> An opinionated eslint config for Vuetify.
2+
3+
<!-- automd:badges color="blue" license -->
4+
5+
[![npm version](https://img.shields.io/npm/v/eslint-config-vuetify?color=blue)](https://npmjs.com/package/eslint-config-vuetify)
6+
[![npm downloads](https://img.shields.io/npm/dm/eslint-config-vuetify?color=blue)](https://npm.chart.dev/eslint-config-vuetify)
7+
[![license](https://img.shields.io/github/license/vuetifyjs/eslint-config-vuetify?color=blue)](https://github.com/vuetifyjs/eslint-config-vuetify/blob/main/LICENSE)
8+
9+
<!-- /automd -->
10+
11+
✨ An opinionated eslint config for Vuetify, crafted to keep your code clean and consistent!
412

513
### 💿 Install
614

7-
```bash
8-
npm install eslint-config-vuetify --save-dev
9-
```
10-
OR
15+
<!-- automd:pm-install dev auto=false -->
16+
17+
```sh
18+
# npm
19+
npm install -D eslint-config-vuetify
20+
21+
# yarn
22+
yarn add -D eslint-config-vuetify
1123

12-
```bash
13-
yarn add eslint-config-vuetify -D
14-
```
15-
OR
24+
# pnpm
25+
pnpm install -D eslint-config-vuetify
1626

17-
```bash
18-
pnpm add eslint-config-vuetify -D
27+
# bun
28+
bun install -D eslint-config-vuetify
29+
30+
# deno
31+
deno install --dev eslint-config-vuetify
1932
```
2033

34+
<!-- /automd -->
35+
2136
### 🚀 Usage
2237

2338
Update your `eslint.config.js` flat config to _extend_ vuetify:
2439

2540
```js
2641
import vuetify from 'eslint-config-vuetify';
2742

28-
export default [
29-
...vuetify,
30-
]
43+
export default vuetify()
44+
```
45+
46+
Most features are automatically detected, but you can explicitly turn them on/off or customize them
47+
48+
```js
49+
import vuetify from 'eslint-config-vuetify';
50+
51+
export default vuetify({
52+
vue: true,
53+
ts: {
54+
preset: 'all'
55+
}
56+
})
57+
```
58+
59+
You can provide additional ESLint configurations after the options object, or directly specify them for simpler use cases where the default settings work fine:
60+
61+
```js
62+
import vuetify from 'eslint-config-vuetify'
63+
64+
export default vuetify(
65+
{
66+
pnpm: false,
67+
},
68+
{
69+
plugins: {
70+
sonarjs,
71+
},
72+
rules: {
73+
...sonarjs.configs.recommended.rules,
74+
},
75+
}
76+
)
77+
```
78+
79+
```js
80+
import vuetify from 'eslint-config-vuetify'
81+
82+
export default vuetify({
83+
rules: {
84+
'no-console': 'error',
85+
},
86+
})
3187
```
3288

3389
### 💪 Supporting Vuetify
@@ -59,3 +115,11 @@ export default [
59115
[MIT](http://opensource.org/licenses/MIT)
60116

61117
Copyright (c) 2016-present Vuetify LLC
118+
119+
----
120+
121+
This project exists and thrives thanks to all the wonderful people who contribute 😍
122+
<br><br>
123+
<a href="https://github.com/vuetifyjs/eslint-config-vuetify/graphs/contributors">
124+
<img src="https://contrib.rocks/image?repo=vuetifyjs/eslint-config-vuetify" />
125+
</a>

build.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
rollup: { inlineDependencies: ['valibot'] },
5+
})

eslint.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export { default } from './index.ts.mjs'
1+
import vuetify from 'eslint-config-vuetify'
2+
3+
export default vuetify()

index.js.mjs

Lines changed: 0 additions & 117 deletions
This file was deleted.

index.js.mjs.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

index.ts.mjs

Lines changed: 0 additions & 16 deletions
This file was deleted.

index.ts.mjs.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,84 @@
22
"name": "eslint-config-vuetify",
33
"version": "3.0.3",
44
"description": "eslint config for vue.js projects",
5-
"main": "index.js.mjs",
6-
"module": "index.ts.mjs",
7-
"types": "types.d.ts",
85
"type": "module",
6+
"scripts": {
7+
"typegen": "tsx scripts/typegen.ts",
8+
"build": "node --run typegen && unbuild",
9+
"prepack": "node --run build",
10+
"stub": "unbuild --stub",
11+
"test": "vitest run",
12+
"dev": "vitest",
13+
"dev:prepare": "node --run typegen && node --run stub"
14+
},
915
"exports": {
1016
".": {
11-
"types": "./types.d.ts",
12-
"import": "./index.js.mjs"
13-
},
14-
"./index.js.mjs": {
15-
"types": "./types.d.ts",
16-
"import": "./index.js.mjs"
17-
},
18-
"./index.ts.mjs": {
19-
"types": "./types.d.ts",
20-
"import": "./index.ts.mjs"
17+
"import": "./dist/index.mjs",
18+
"require": "./dist/index.cjs"
2119
}
2220
},
21+
"main": "./dist/index.cjs",
22+
"types": "./dist/index.d.ts",
2323
"files": [
24-
"index.js.mjs.d.ts",
25-
"index.ts.mjs.d.ts",
26-
"index.js.mjs",
27-
"index.ts.mjs",
28-
"types.d.ts",
29-
"utils"
24+
"dist"
3025
],
3126
"repository": {
3227
"type": "git",
3328
"url": "git+https://github.com/vuetifyjs/eslint-config-vuetify.git"
3429
},
3530
"keywords": [
3631
"eslint",
32+
"config",
33+
"eslint-config",
3734
"vue",
3835
"vuetify"
3936
],
4037
"author": "John Leider <[email protected]>",
4138
"license": "MIT",
4239
"peerDependencies": {
43-
"eslint": "^9.23.0"
40+
"@vitest/eslint-plugin": "^1.1.42",
41+
"eslint": "^9.5.0",
42+
"eslint-plugin-jest": "^28.0.0",
43+
"eslint-plugin-no-only-tests": "^3.3.0",
44+
"eslint-plugin-vuejs-accessibility": "^2.0.0"
4445
},
4546
"dependencies": {
46-
"@eslint/js": "^9.23.0",
47+
"@clack/prompts": "^0.10.1",
48+
"@eslint/eslintrc": "^3.3.1",
49+
"@eslint/js": "^9.25.1",
4750
"@stylistic/eslint-plugin": "^4.2.0",
48-
"@vue/eslint-config-typescript": "^14.5.0",
49-
"defu": "^6.1.4",
51+
"@typescript-eslint/parser": "^8.31.0",
52+
"eslint-config-flat-gitignore": "^2.1.0",
53+
"eslint-flat-config-utils": "^2.0.1",
54+
"eslint-plugin-antfu": "^3.1.1",
55+
"eslint-plugin-import-x": "^4.10.6",
56+
"eslint-plugin-jsonc": "^2.20.0",
57+
"eslint-plugin-perfectionist": "^4.12.1",
58+
"eslint-plugin-pnpm": "^0.3.1",
59+
"eslint-plugin-regexp": "^2.7.0",
60+
"eslint-plugin-unicorn": "^58.0.0",
5061
"eslint-plugin-vue": "^10.0.0",
51-
"exsolve": "^1.0.4",
62+
"eslint-typegen": "^2.1.0",
63+
"exsolve": "^1.0.5",
5264
"globals": "^16.0.0",
53-
"jiti": "^2.4.2"
54-
}
65+
"jsonc-eslint-parser": "^2.4.0",
66+
"kolorist": "^1.8.0",
67+
"local-pkg": "^1.1.1",
68+
"nypm": "^0.6.0",
69+
"package-manager-detector": "^1.2.0",
70+
"typescript-eslint": "^8.31.0",
71+
"vue-eslint-parser": "^10.1.3",
72+
"yaml-eslint-parser": "^1.3.0"
73+
},
74+
"devDependencies": {
75+
"@types/node": "^22.13.17",
76+
"eslint-config-vuetify": "file:../eslint-config-vuetify",
77+
"tsx": "^4.19.3",
78+
"typescript": "^5.8.2",
79+
"unbuild": "^3.5.0",
80+
"valibot": "^1.0.0",
81+
"vitest": "^3.1.2",
82+
"vue": "^3.5.13"
83+
},
84+
"packageManager": "[email protected]"
5585
}

0 commit comments

Comments
 (0)