@swissgeo/config-eslint 1.0.0-rc.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,6 +44,24 @@ export default [
44
44
  ]
45
45
  ```
46
46
 
47
+ ### Granular Configurations
48
+
49
+ You can also import specific configurations if you don't want the full default set:
50
+
51
+ - `vueConfig`: Vue 3 specific rules
52
+ - `unitTestsConfig`: Mocha/Chai rules for `*.spec.{js,ts}`
53
+ - `markdownConfig`: Markdown linting rules
54
+ - `jsConfig`: Standard JavaScript rules
55
+
56
+ ```typescript
57
+ import { jsConfig, vueConfig } from '@swissgeo/config-eslint'
58
+
59
+ export default [
60
+ ...jsConfig,
61
+ ...vueConfig,
62
+ ]
63
+ ```
64
+
47
65
  ### Custom Configuration
48
66
 
49
67
  You can extend or override the default configuration:
package/dist/index.d.ts CHANGED
@@ -1,15 +1,23 @@
1
- import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
2
- /**
3
- * Generates a set of ESLint rules for Cypress tests. The root directory of the Cypress tests can be
4
- * specified (the default value is 'tests/cypress/').
5
- *
6
- * @param cypressRootDir The root directory of the Cypress tests.
7
- * @returns The set of ESLint rules for Cypress tests.
8
- */
9
- export declare function cypressConfig(cypressRootDir?: string): FlatConfig.ConfigArray;
10
- export declare const vueConfig: FlatConfig.ConfigArray;
11
- export declare const unitTestsConfig: FlatConfig.ConfigArray;
12
- export declare const markdownConfig: FlatConfig.ConfigArray;
13
- export declare const jsConfig: FlatConfig.ConfigArray;
14
- declare const defaultConfig: FlatConfig.ConfigArray;
15
- export default defaultConfig;
1
+ import { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
2
+
3
+ /**
4
+ * Generates a set of ESLint rules for Cypress tests. The root directory of the Cypress tests can be
5
+ * specified (the default value is 'tests/cypress/').
6
+ *
7
+ * @param cypressRootDir The root directory of the Cypress tests.
8
+ * @returns The set of ESLint rules for Cypress tests.
9
+ */
10
+ export declare function cypressConfig(cypressRootDir?: string): FlatConfig.ConfigArray;
11
+
12
+ declare const defaultConfig: FlatConfig.ConfigArray;
13
+ export default defaultConfig;
14
+
15
+ export declare const jsConfig: FlatConfig.ConfigArray;
16
+
17
+ export declare const markdownConfig: FlatConfig.ConfigArray;
18
+
19
+ export declare const unitTestsConfig: FlatConfig.ConfigArray;
20
+
21
+ export declare const vueConfig: FlatConfig.ConfigArray;
22
+
23
+ export { }
package/dist/index.js CHANGED
@@ -1,213 +1,223 @@
1
- import jsESLint from '@eslint/js';
2
- import markdown from '@eslint/markdown';
3
- import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
4
- import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript';
5
- import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
6
- import pluginCypress from 'eslint-plugin-cypress';
7
- import pluginImport from 'eslint-plugin-import';
8
- import mocha from 'eslint-plugin-mocha';
9
- import perfectionist from 'eslint-plugin-perfectionist';
10
- import pluginVue from 'eslint-plugin-vue';
11
- import globals from 'globals';
12
- import tsESLint from 'typescript-eslint';
13
- const commonTsAndJsRules = {
14
- eqeqeq: ['error', 'always'],
15
- 'no-console': 'error',
16
- 'no-var': 'error',
17
- // Enforce a consistent brace style for all control statements
18
- curly: ['error', 'all'],
19
- // Enforce opening braces on the same line and closing brace on a new line
20
- 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
21
- 'perfectionist/sort-imports': [
22
- 'error',
23
- {
24
- type: 'alphabetical',
25
- internalPattern: ['^@/.*'],
26
- },
27
- ],
28
- 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
29
- // has some issue (with typescript-eslint for instance), so we disable it (TS does already a good job at detecting unresolved imports)
30
- 'import/no-unresolved': 'off',
31
- };
32
- const noUnusedVarsRules = {
33
- 'no-unused-vars': [
34
- 'error',
35
- {
36
- argsIgnorePattern: '^_',
37
- caughtErrorsIgnorePattern: '^_',
38
- destructuredArrayIgnorePattern: '^_',
39
- },
40
- ],
41
- '@typescript-eslint/no-unused-vars': [
42
- 'error',
43
- {
44
- argsIgnorePattern: '^_',
45
- caughtErrorsIgnorePattern: '^_',
46
- destructuredArrayIgnorePattern: '^_',
47
- },
48
- ],
49
- };
50
- const standardTSRules = {
51
- 'no-unused-vars': 'off',
52
- '@typescript-eslint/no-unused-vars': [
53
- 'error',
54
- {
55
- // as we are adding dispatcher reference in all our store action, but won't be using
56
- // them directly in the action, we must ignore these unused variables too
57
- argsIgnorePattern: '^(_|dispatcher)',
58
- caughtErrorsIgnorePattern: '^_',
59
- destructuredArrayIgnorePattern: '^_',
60
- },
61
- ],
62
- '@typescript-eslint/consistent-type-exports': 'error',
63
- '@typescript-eslint/no-import-type-side-effects': 'error',
64
- '@typescript-eslint/consistent-type-imports': [
65
- 'error',
66
- {
67
- prefer: 'type-imports',
68
- fixStyle: 'separate-type-imports',
69
- },
70
- ],
1
+ import g from "@eslint/js";
2
+ import d from "@eslint/markdown";
3
+ import y from "@vue/eslint-config-prettier/skip-formatting";
4
+ import { defineConfigWithVueTs as _, vueTsConfigs as I } from "@vue/eslint-config-typescript";
5
+ import p from "eslint-plugin-chai-friendly";
6
+ import C from "eslint-plugin-cypress";
7
+ import e from "eslint-plugin-import";
8
+ import h from "eslint-plugin-mocha";
9
+ import s from "eslint-plugin-perfectionist";
10
+ import v from "eslint-plugin-vue";
11
+ import o from "globals";
12
+ import r from "typescript-eslint";
13
+ const t = {
14
+ eqeqeq: ["error", "always"],
15
+ "no-console": "error",
16
+ "no-var": "error",
17
+ // Enforce a consistent brace style for all control statements
18
+ curly: ["error", "all"],
19
+ // Enforce opening braces on the same line and closing brace on a new line
20
+ "brace-style": ["error", "1tbs", { allowSingleLine: !1 }],
21
+ "perfectionist/sort-imports": [
22
+ "error",
23
+ {
24
+ type: "alphabetical",
25
+ internalPattern: ["^@/.*"]
26
+ }
27
+ ],
28
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
29
+ // has some issue (with typescript-eslint for instance), so we disable it (TS does already a good job at detecting unresolved imports)
30
+ "import/no-unresolved": "off"
31
+ }, n = {
32
+ "no-unused-vars": [
33
+ "error",
34
+ {
35
+ argsIgnorePattern: "^_",
36
+ caughtErrorsIgnorePattern: "^_",
37
+ destructuredArrayIgnorePattern: "^_"
38
+ }
39
+ ],
40
+ "@typescript-eslint/no-unused-vars": [
41
+ "error",
42
+ {
43
+ argsIgnorePattern: "^_",
44
+ caughtErrorsIgnorePattern: "^_",
45
+ destructuredArrayIgnorePattern: "^_"
46
+ }
47
+ ]
48
+ }, l = {
49
+ "no-unused-vars": "off",
50
+ "@typescript-eslint/no-unused-vars": [
51
+ "error",
52
+ {
53
+ // as we are adding dispatcher reference in all our store action, but won't be using
54
+ // them directly in the action, we must ignore these unused variables too
55
+ argsIgnorePattern: "^(_|dispatcher)",
56
+ caughtErrorsIgnorePattern: "^_",
57
+ destructuredArrayIgnorePattern: "^_"
58
+ }
59
+ ],
60
+ "@typescript-eslint/consistent-type-exports": "error",
61
+ "@typescript-eslint/no-import-type-side-effects": "error",
62
+ "@typescript-eslint/consistent-type-imports": [
63
+ "error",
64
+ {
65
+ prefer: "type-imports",
66
+ fixStyle: "separate-type-imports"
67
+ }
68
+ ]
69
+ }, a = {
70
+ plugins: {
71
+ "chai-friendly": p
72
+ },
73
+ rules: {
74
+ "no-console": "off",
75
+ "no-prototype-builtins": "off",
76
+ // see https://github.com/ihordiachenko/eslint-plugin-chai-friendly?tab=readme-ov-file#usage
77
+ "no-unused-expressions": "off",
78
+ // disable original rule for JS
79
+ "@typescript-eslint/no-unused-expressions": "off",
80
+ // disable original rule for TS
81
+ "chai-friendly/no-unused-expressions": "error",
82
+ ...n
83
+ }
71
84
  };
72
- const chaiFriendlyRules = {
85
+ function N(i = "tests/cypress/") {
86
+ return r.config([
87
+ {
88
+ files: [`${i}**/*.ts`, `${i}**/*.js`],
89
+ languageOptions: {
90
+ parserOptions: {
91
+ projectService: !0,
92
+ tsconfigRootDir: import.meta.dirname
93
+ }
94
+ },
95
+ rules: l,
96
+ ...C.configs.recommended,
97
+ ...a
98
+ }
99
+ ]);
100
+ }
101
+ const f = [
102
+ ".gitignore",
103
+ "**/node_modules",
104
+ "**/.github",
105
+ "**/dist",
106
+ "tsconfig.json",
107
+ "**/*.md",
108
+ "**/eslint.config.mts"
109
+ ], c = _(
110
+ e.flatConfigs.recommended,
111
+ e.flatConfigs.typescript,
112
+ v.configs["flat/essential"],
113
+ r.configs.recommended,
114
+ I.recommendedTypeCheckedOnly,
115
+ {
116
+ files: ["**/*.vue"],
73
117
  plugins: {
74
- 'chai-friendly': pluginChaiFriendly,
118
+ perfectionist: s
75
119
  },
76
120
  rules: {
77
- 'no-console': 'off',
78
- 'no-prototype-builtins': 'off',
79
- // see https://github.com/ihordiachenko/eslint-plugin-chai-friendly?tab=readme-ov-file#usage
80
- 'no-unused-expressions': 'off', // disable original rule for JS
81
- '@typescript-eslint/no-unused-expressions': 'off', // disable original rule for TS
82
- 'chai-friendly/no-unused-expressions': 'error',
83
- ...noUnusedVarsRules,
84
- },
85
- };
86
- /**
87
- * Generates a set of ESLint rules for Cypress tests. The root directory of the Cypress tests can be
88
- * specified (the default value is 'tests/cypress/').
89
- *
90
- * @param cypressRootDir The root directory of the Cypress tests.
91
- * @returns The set of ESLint rules for Cypress tests.
92
- */
93
- export function cypressConfig(cypressRootDir = 'tests/cypress/') {
94
- return tsESLint.config([
95
- {
96
- files: [`${cypressRootDir}**/*.ts`, `${cypressRootDir}**/*.js`],
97
- languageOptions: {
98
- parserOptions: {
99
- projectService: true,
100
- tsconfigRootDir: import.meta.dirname,
101
- },
102
- },
103
- rules: standardTSRules,
104
- ...pluginCypress.configs.recommended,
105
- ...chaiFriendlyRules,
106
- },
107
- ]);
108
- }
109
- const allIgnores = [
110
- '.gitignore',
111
- '**/node_modules',
112
- '**/.github',
113
- '**/dist',
114
- 'tsconfig.json',
115
- '**/*.md',
116
- '**/eslint.config.mts',
117
- ];
118
- export const vueConfig = defineConfigWithVueTs(pluginImport.flatConfigs.recommended, pluginImport.flatConfigs.typescript, pluginVue.configs['flat/essential'], tsESLint.configs.recommended, vueTsConfigs.recommendedTypeCheckedOnly, {
119
- files: ['**/*.vue'],
121
+ ...t,
122
+ "vue/html-indent": ["error", 4],
123
+ "vue/block-lang": "error",
124
+ ...n
125
+ }
126
+ }
127
+ ), u = [
128
+ {
129
+ files: ["**/*.spec.{js,ts}", "scripts/**.{js,ts}"],
130
+ ...a
131
+ }
132
+ ], m = [
133
+ {
134
+ files: ["**/*.md"],
120
135
  plugins: {
121
- perfectionist,
136
+ markdown: d
122
137
  },
138
+ processor: "markdown/markdown",
123
139
  rules: {
124
- ...commonTsAndJsRules,
125
- 'vue/html-indent': ['error', 4],
126
- 'vue/block-lang': 'error',
127
- ...noUnusedVarsRules,
128
- },
129
- });
130
- export const unitTestsConfig = [
131
- {
132
- files: ['**/*.spec.{js,ts}', 'scripts/**.{js,ts}'],
133
- ...chaiFriendlyRules,
134
- },
135
- ];
136
- export const markdownConfig = [
137
- {
138
- files: ['**/*.md'],
139
- plugins: {
140
- markdown: markdown,
141
- },
142
- processor: 'markdown/markdown',
143
- rules: {
144
- 'no-irregular-whitespace': 'off',
145
- 'no-undef': 'off',
146
- },
147
- },
148
- ];
149
- export const jsConfig = [
150
- jsESLint.configs.recommended,
151
- {
152
- ignores: allIgnores,
140
+ "no-irregular-whitespace": "off",
141
+ "no-undef": "off"
142
+ }
143
+ }
144
+ ], T = [
145
+ g.configs.recommended,
146
+ {
147
+ ignores: f
148
+ },
149
+ {
150
+ files: ["**/*.js", "**/*.jsx"],
151
+ // no need to check our snippets
152
+ ignores: ["**/*.md"],
153
+ plugins: {
154
+ mocha: h,
155
+ "chai-friendly": p,
156
+ perfectionist: s
153
157
  },
154
- {
155
- files: ['**/*.js', '**/*.jsx'],
156
- // no need to check our snippets
157
- ignores: ['**/*.md'],
158
- plugins: {
159
- mocha,
160
- 'chai-friendly': pluginChaiFriendly,
161
- perfectionist,
162
- },
163
- languageOptions: {
164
- ecmaVersion: 'latest',
165
- globals: {
166
- ...globals.browser,
167
- ...globals.vitest,
168
- ...globals.node,
169
- defineModel: 'readonly',
170
- __APP_VERSION__: true,
171
- __VITE_ENVIRONMENT__: true,
172
- __CESIUM_STATIC_PATH__: true,
173
- __IS_TESTING_WITH_CYPRESS__: true,
174
- },
175
- sourceType: 'module',
176
- },
177
- rules: {
178
- ...commonTsAndJsRules,
179
- 'mocha/no-exclusive-tests': 'error',
180
- ...noUnusedVarsRules,
181
- },
158
+ languageOptions: {
159
+ ecmaVersion: "latest",
160
+ globals: {
161
+ ...o.browser,
162
+ ...o.vitest,
163
+ ...o.node,
164
+ defineModel: "readonly",
165
+ __APP_VERSION__: !0,
166
+ __VITE_ENVIRONMENT__: !0,
167
+ __CESIUM_STATIC_PATH__: !0,
168
+ __IS_TESTING_WITH_CYPRESS__: !0
169
+ },
170
+ sourceType: "module"
182
171
  },
183
- ...markdownConfig,
184
- ...unitTestsConfig,
185
- ...vueConfig,
186
- // skip the formatting in the linting process
187
- skipFormatting,
188
- ];
189
- const defaultConfig = tsESLint.config(pluginImport.flatConfigs.recommended, pluginImport.flatConfigs.typescript, ...jsConfig, tsESLint.configs.recommended, ...markdownConfig, ...vueConfig, {
190
- ignores: allIgnores,
191
- }, {
192
- files: ['**/*.ts', '**/*.tsx'],
172
+ rules: {
173
+ ...t,
174
+ "mocha/no-exclusive-tests": "error",
175
+ ...n
176
+ }
177
+ },
178
+ ...m,
179
+ ...u,
180
+ ...c,
181
+ // skip the formatting in the linting process
182
+ y
183
+ ], q = r.config(
184
+ e.flatConfigs.recommended,
185
+ e.flatConfigs.typescript,
186
+ ...T,
187
+ r.configs.recommended,
188
+ ...m,
189
+ ...c,
190
+ {
191
+ ignores: f
192
+ },
193
+ {
194
+ files: ["**/*.ts", "**/*.tsx"],
193
195
  // no need to check our snippets
194
- ignores: ['**/*.md'],
196
+ ignores: ["**/*.md"],
195
197
  plugins: {
196
- perfectionist,
198
+ perfectionist: s
197
199
  },
198
200
  languageOptions: {
199
- parserOptions: {
200
- projectService: true,
201
- tsconfigRootDir: import.meta.dirname,
202
- },
201
+ parserOptions: {
202
+ projectService: !0,
203
+ tsconfigRootDir: import.meta.dirname
204
+ }
203
205
  },
204
206
  // switching to TypeScript unused var rule (instead of JS rule), so that no error is raised
205
207
  // on unused param from abstract function arguments
206
208
  rules: {
207
- ...standardTSRules,
208
- ...commonTsAndJsRules,
209
- },
210
- },
211
- // we have to declare that AFTER the TS specifics, our unit test rules from the JS config are otherwise ignored (when the tests are written in TS)
212
- unitTestsConfig);
213
- export default defaultConfig;
209
+ ...l,
210
+ ...t
211
+ }
212
+ },
213
+ // we have to declare that AFTER the TS specifics, our unit test rules from the JS config are otherwise ignored (when the tests are written in TS)
214
+ u
215
+ );
216
+ export {
217
+ N as cypressConfig,
218
+ q as default,
219
+ T as jsConfig,
220
+ m as markdownConfig,
221
+ u as unitTestsConfig,
222
+ c as vueConfig
223
+ };
@@ -0,0 +1 @@
1
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@eslint/js"),require("@eslint/markdown"),require("@vue/eslint-config-prettier/skip-formatting"),require("@vue/eslint-config-typescript"),require("eslint-plugin-chai-friendly"),require("eslint-plugin-cypress"),require("eslint-plugin-import"),require("eslint-plugin-mocha"),require("eslint-plugin-perfectionist"),require("eslint-plugin-vue"),require("globals"),require("typescript-eslint")):typeof define=="function"&&define.amd?define(["exports","@eslint/js","@eslint/markdown","@vue/eslint-config-prettier/skip-formatting","@vue/eslint-config-typescript","eslint-plugin-chai-friendly","eslint-plugin-cypress","eslint-plugin-import","eslint-plugin-mocha","eslint-plugin-perfectionist","eslint-plugin-vue","globals","typescript-eslint"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e["@swissgeo/config-eslint"]={},e.jsESLint,e.markdown,e.skipFormatting,e.eslintConfigTypescript,e.pluginChaiFriendly,e.pluginCypress,e.pluginImport,e.mocha,e.perfectionist,e.pluginVue,e.globals,e.tsESLint))})(this,function(e,r,v,h,f,d,C,n,T,i,I,t,s){"use strict";const o={eqeqeq:["error","always"],"no-console":"error","no-var":"error",curly:["error","all"],"brace-style":["error","1tbs",{allowSingleLine:!1}],"perfectionist/sort-imports":["error",{type:"alphabetical",internalPattern:["^@/.*"]}],"import/consistent-type-specifier-style":["error","prefer-top-level"],"import/no-unresolved":"off"},u={"no-unused-vars":["error",{argsIgnorePattern:"^_",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_"}],"@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_"}]},g={"no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^(_|dispatcher)",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_"}],"@typescript-eslint/consistent-type-exports":"error","@typescript-eslint/no-import-type-side-effects":"error","@typescript-eslint/consistent-type-imports":["error",{prefer:"type-imports",fixStyle:"separate-type-imports"}]},a={plugins:{"chai-friendly":d},rules:{"no-console":"off","no-prototype-builtins":"off","no-unused-expressions":"off","@typescript-eslint/no-unused-expressions":"off","chai-friendly/no-unused-expressions":"error",...u}};function j(_="tests/cypress/"){return s.config([{files:[`${_}**/*.ts`,`${_}**/*.js`],languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:void 0}},rules:g,...C.configs.recommended,...a}])}const m=[".gitignore","**/node_modules","**/.github","**/dist","tsconfig.json","**/*.md","**/eslint.config.mts"],l=f.defineConfigWithVueTs(n.flatConfigs.recommended,n.flatConfigs.typescript,I.configs["flat/essential"],s.configs.recommended,f.vueTsConfigs.recommendedTypeCheckedOnly,{files:["**/*.vue"],plugins:{perfectionist:i},rules:{...o,"vue/html-indent":["error",4],"vue/block-lang":"error",...u}}),c=[{files:["**/*.spec.{js,ts}","scripts/**.{js,ts}"],...a}],p=[{files:["**/*.md"],plugins:{markdown:v},processor:"markdown/markdown",rules:{"no-irregular-whitespace":"off","no-undef":"off"}}],y=[r.configs.recommended,{ignores:m},{files:["**/*.js","**/*.jsx"],ignores:["**/*.md"],plugins:{mocha:T,"chai-friendly":d,perfectionist:i},languageOptions:{ecmaVersion:"latest",globals:{...t.browser,...t.vitest,...t.node,defineModel:"readonly",__APP_VERSION__:!0,__VITE_ENVIRONMENT__:!0,__CESIUM_STATIC_PATH__:!0,__IS_TESTING_WITH_CYPRESS__:!0},sourceType:"module"},rules:{...o,"mocha/no-exclusive-tests":"error",...u}},...p,...c,...l,h],q=s.config(n.flatConfigs.recommended,n.flatConfigs.typescript,...y,s.configs.recommended,...p,...l,{ignores:m},{files:["**/*.ts","**/*.tsx"],ignores:["**/*.md"],plugins:{perfectionist:i},languageOptions:{parserOptions:{projectService:!0,tsconfigRootDir:void 0}},rules:{...g,...o}},c);e.cypressConfig=j,e.default=q,e.jsConfig=y,e.markdownConfig=p,e.unitTestsConfig=c,e.vueConfig=l,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swissgeo/config-eslint",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0",
4
4
  "description": "Shared ESLint config for SWISSGEO projects.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,33 +17,35 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@eslint/js": "^9.39.1",
20
+ "@eslint/js": "^9.39.2",
21
21
  "@eslint/markdown": "^7.5.1",
22
- "@typescript-eslint/utils": "^8.46.4",
22
+ "@typescript-eslint/utils": "^8.52.0",
23
23
  "@vue/eslint-config-prettier": "^10.2.0",
24
24
  "@vue/eslint-config-typescript": "^14.6.0",
25
25
  "eslint-plugin-chai-friendly": "^1.1.0",
26
26
  "eslint-plugin-cypress": "^5.2.0",
27
27
  "eslint-plugin-import": "^2.32.0",
28
28
  "eslint-plugin-mocha": "^11.2.0",
29
- "eslint-plugin-perfectionist": "^4.15.1",
29
+ "eslint-plugin-perfectionist": "^5.2.0",
30
30
  "eslint-plugin-prettier": "^5.5.4",
31
- "eslint-plugin-vue": "^10.5.1",
32
- "typescript-eslint": "^8.49.0"
31
+ "eslint-plugin-vue": "^10.6.2",
32
+ "typescript-eslint": "^8.52.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@microsoft/api-extractor": "^7.55.0",
36
- "@types/node": "^24.10.1",
37
- "globals": "^16.5.0",
35
+ "@microsoft/api-extractor": "^7.55.2",
36
+ "@types/node": "ts5.9",
37
+ "globals": "^17.0.0",
38
38
  "typescript": "^5.9.3",
39
- "@swissgeo/config-typescript": "1.0.0-rc.1"
39
+ "unplugin-dts": "1.0.0-beta.6",
40
+ "vite": "7.2.2",
41
+ "@swissgeo/config-typescript": "1.0.0"
40
42
  },
41
43
  "peerDependencies": {
42
- "eslint": "^9.39.1",
43
- "@swissgeo/config-stylelint": "1.0.0-rc.1"
44
+ "eslint": "^9.39.2",
45
+ "@swissgeo/config-stylelint": "1.0.0"
44
46
  },
45
47
  "scripts": {
46
- "build": "pnpm run type-check && pnpm run generate-types",
48
+ "build": "pnpm run type-check && pnpm run generate-types && vite build",
47
49
  "generate-types": "tsc --declaration",
48
50
  "lint": "eslint --fix",
49
51
  "lint:no-fix": "eslint",
package/tsconfig.json CHANGED
@@ -1,12 +1,4 @@
1
1
  {
2
- "files": ["index.ts"],
3
- "include": ["types/*.ts"],
4
- "compilerOptions": {
5
- "target": "ESNext",
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "noEmitOnError": false,
9
- "outDir": "dist",
10
- "types": ["node"]
11
- }
2
+ "extends": "@swissgeo/config-typescript/tsconfig.base.json",
3
+ "include": ["**/*.ts"]
12
4
  }
package/vite.config.ts ADDED
@@ -0,0 +1,38 @@
1
+ import type { UserConfig } from 'vite'
2
+
3
+ import { resolve } from 'path'
4
+ import dts from 'unplugin-dts/vite'
5
+
6
+ const config: UserConfig = {
7
+ build: {
8
+ lib: {
9
+ entry: {
10
+ index: resolve(__dirname, 'index.ts'),
11
+ },
12
+ name: '@swissgeo/config-eslint',
13
+ },
14
+ rollupOptions: {
15
+ // Mark ESLint-related packages as external so Vite doesn't try to bundle them.
16
+ // These packages use Node.js built-ins and can't be bundled for browser use.
17
+ // This is safe because the config is only used in Node.js during linting.
18
+ external: [
19
+ /^@eslint\/.*/,
20
+ /^@typescript-eslint\/.*/,
21
+ /^@vue\/.*/,
22
+ /^eslint.*/,
23
+ /^typescript-eslint/,
24
+ 'globals',
25
+ ],
26
+ output: {
27
+ exports: 'named',
28
+ },
29
+ },
30
+ },
31
+ plugins: [
32
+ dts({
33
+ bundleTypes: true,
34
+ }),
35
+ ],
36
+ }
37
+
38
+ export default config