@blockquote/create-wc 2.15.1 → 2.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockquote/create-wc",
3
- "version": "2.15.1",
3
+ "version": "2.16.0",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "Lit",
@@ -68,23 +68,12 @@
68
68
  ]
69
69
  },
70
70
  "devDependencies": {
71
- "@eslint/js": "^10.0.1",
72
- "@html-eslint/eslint-plugin": "^0.64.0",
73
- "@html-eslint/parser": "^0.64.0",
71
+ "@blockquote/eslint-config": "^0.1.1",
74
72
  "eslint": "^10.8.1",
75
- "eslint-config-prettier": "^10.1.8",
76
- "eslint-import-resolver-typescript": "4.4.5",
77
- "eslint-plugin-html": "^8.1.4",
78
- "eslint-plugin-import-x": "^4.17.1",
79
- "eslint-plugin-lit": "^2.3.1",
80
- "eslint-plugin-lit-a11y": "^5.1.1",
81
- "eslint-plugin-wc": "^3.1.0",
82
- "globals": "^17.11.0",
83
73
  "husky": "^9.1.7",
84
74
  "lint-staged": "^17.3.0",
85
75
  "prettier": "^3.9.6",
86
76
  "stylelint": "^17.14.1",
87
- "stylelint-config-standard-scss": "^17.0.0",
88
- "typescript-eslint": "^8.67.0"
77
+ "stylelint-config-standard-scss": "^17.0.0"
89
78
  }
90
79
  }
@@ -1,283 +1,5 @@
1
- import js from '@eslint/js';
2
- import {configs as wc} from 'eslint-plugin-wc';
3
- import {configs as lit} from 'eslint-plugin-lit';
4
- import {default as litA11y} from 'eslint-plugin-lit-a11y';
5
- import {flatConfigs as importPlugin, createNodeResolver} from 'eslint-plugin-import-x';
6
- import {configs as tseslint, parser as tsParser} from 'typescript-eslint';
7
- import htmlEslint from '@html-eslint/eslint-plugin';
8
- import htmlEslintParser from '@html-eslint/parser';
9
- import eslintPluginHtml from 'eslint-plugin-html';
10
- import eslintConfigPrettier from 'eslint-config-prettier';
11
- import globals from 'globals';
1
+ import {defineConfig} from 'eslint/config';
2
+ import createConfig from '@blockquote/eslint-config';
12
3
 
13
- const fileTypes = '{js,ts,mjs}';
14
-
15
- //
16
- // ──────────────────────────────────────────────────────────────
17
- // Base config
18
- // ──────────────────────────────────────────────────────────────
19
- //
20
- const baseConfig = [
21
- js.configs.recommended,
22
- {
23
- languageOptions: {
24
- ecmaVersion: 'latest',
25
- sourceType: 'module',
26
- globals: {
27
- ...globals.browser,
28
- ...globals.es2023,
29
- ...globals.mocha,
30
- },
31
- },
32
- },
33
- ];
34
-
35
- //
36
- // ──────────────────────────────────────────────────────────────
37
- // eslint-plugin-import-x
38
- // ──────────────────────────────────────────────────────────────
39
- //
40
- const importFilesConfig = [importPlugin.recommended, importPlugin.typescript].map((conf) => ({
41
- ...conf,
42
- files: [`**/*.${fileTypes}`],
43
- languageOptions: {
44
- ...conf.languageOptions,
45
- parser: tsParser,
46
- parserOptions: {
47
- tsconfigRootDir: import.meta.dirname,
48
- },
49
- },
50
- }));
51
-
52
- const importFilesRules = {
53
- files: [`**/*.${fileTypes}`],
54
- rules: {
55
- 'import-x/extensions': ['error', 'always', {ignorePackages: true}],
56
- 'import-x/no-extraneous-dependencies': [
57
- 'error',
58
- {
59
- devDependencies: [
60
- `**/demo/**/*.${fileTypes}`,
61
- `**/test/**/*.${fileTypes}`,
62
- `**/*.config.${fileTypes}`,
63
- `**/*.conf.${fileTypes}`,
64
- ],
65
- },
66
- ],
67
- 'import-x/no-unresolved': 'off',
68
- 'import-x/prefer-default-export': 'off',
69
- },
70
- };
71
-
72
- //
73
- // ──────────────────────────────────────────────────────────────
74
- // eslint-plugin-lit-a11y
75
- // ──────────────────────────────────────────────────────────────
76
- //
77
- const litA11yFilesConfig = [
78
- {
79
- // @ts-ignore
80
- ...litA11y.configs.recommended,
81
- files: [`**/*.${fileTypes}`],
82
- },
83
- ];
84
-
85
- const litA11yFilesRules = {
86
- files: [`**/*.${fileTypes}`],
87
- rules: {
88
- 'lit-a11y/no-autofocus': 'off',
89
- 'lit-a11y/anchor-is-valid': 'off',
90
- 'lit-a11y/click-events-have-key-events': 'off',
91
- },
92
- };
93
-
94
- //
95
- // ──────────────────────────────────────────────────────────────
96
- // eslint-plugin-wc
97
- // ──────────────────────────────────────────────────────────────
98
- //
99
- const wcFilesConfig = [
100
- {
101
- ...wc['flat/recommended'],
102
- files: [`**/*.${fileTypes}`],
103
- },
104
- ];
105
-
106
- const wcFilesRules = {
107
- files: [`**/*.${fileTypes}`],
108
- rules: {
109
- 'wc/no-constructor-attributes': 'warn',
110
- },
111
- };
112
-
113
- //
114
- // ──────────────────────────────────────────────────────────────
115
- // eslint-plugin-lit
116
- // ──────────────────────────────────────────────────────────────
117
- //
118
- const litFilesConfig = [
119
- {
120
- ...lit['flat/recommended'],
121
- files: [`**/*.${fileTypes}`],
122
- },
123
- ];
124
-
125
- const litFilesRules = {
126
- files: [`**/*.${fileTypes}`],
127
- rules: {
128
- 'lit/lifecycle-super': 'error',
129
- 'lit/no-native-attributes': 'off',
130
- 'lit/no-useless-template-literals': 'off',
131
- 'lit/binding-positions': 'off',
132
- 'lit/no-invalid-html': 'off',
133
- },
134
- };
135
-
136
- //
137
- // ──────────────────────────────────────────────────────────────
138
- // typescript-eslint
139
- // ──────────────────────────────────────────────────────────────
140
- //
141
- const tsFilesConfig = [...tseslint.strict, ...tseslint.stylistic].map((conf) => ({
142
- ...conf,
143
- files: ['**/*.ts'],
144
- // @ts-ignore
145
- ...(conf.languageOptions && {
146
- languageOptions: {
147
- // @ts-ignore
148
- ...conf.languageOptions,
149
- parserOptions: {
150
- // @ts-ignore
151
- ...conf.languageOptions.parserOptions,
152
- projectService: {
153
- allowDefaultProject: [
154
- `test/*.${fileTypes}`,
155
- `*.config.${fileTypes}`,
156
- `*.conf.${fileTypes}`,
157
- ],
158
- },
159
- tsconfigRootDir: import.meta.dirname,
160
- },
161
- },
162
- }),
163
- }));
164
-
165
- const tsFilesRules = {
166
- files: ['**/*.ts'],
167
- rules: {
168
- '@typescript-eslint/no-floating-promises': 'error',
169
- '@typescript-eslint/ban-types': 'off',
170
- '@typescript-eslint/explicit-function-return-type': 'off',
171
- '@typescript-eslint/explicit-module-boundary-types': 'off',
172
- '@typescript-eslint/no-empty-function': 'off',
173
- '@typescript-eslint/no-non-null-assertion': 'off',
174
- '@typescript-eslint/class-literal-property-style': 'off',
175
- '@typescript-eslint/no-unused-expressions': 'off',
176
- },
177
- };
178
-
179
- //
180
- // ──────────────────────────────────────────────────────────────
181
- // HTML
182
- // ──────────────────────────────────────────────────────────────
183
- //
184
- const htmlFilesConfig = [
185
- {
186
- ...htmlEslint.configs['flat/recommended'],
187
- files: ['**/*.html'],
188
- plugins: {
189
- '@html-eslint': htmlEslint,
190
- },
191
- languageOptions: {
192
- parser: htmlEslintParser,
193
- },
194
- },
195
- ];
196
-
197
- const htmlFilesRules = {
198
- files: ['**/*.html'],
199
- rules: {
200
- '@html-eslint/indent': 'off',
201
- '@html-eslint/require-closing-tags': 'off',
202
- '@html-eslint/no-extra-spacing-tags': 'off',
203
- '@html-eslint/attrs-newline': 'off',
204
- '@html-eslint/use-baseline': ['error', {available: 'newly'}],
205
- },
206
- };
207
-
208
- const eslintPluginHtmlConfig = {
209
- files: ['**/*.html'],
210
- plugins: {eslintPluginHtml},
211
- };
212
-
213
- //
214
- // ──────────────────────────────────────────────────────────────
215
- // Export
216
- // ──────────────────────────────────────────────────────────────
217
- //
218
- export default [
219
- {
220
- ignores: [
221
- '**/.idea',
222
- '**/.tmp',
223
- '**/.vscode',
224
- '**/.wireit',
225
- '**/_site',
226
- '**/build',
227
- '**/coverage',
228
- '**/dev',
229
- '**/dist',
230
- '**/reports',
231
- '**/storybook-static',
232
- '**/*screenshots*',
233
- '**/*snapshots*',
234
- '**/*.config.*',
235
- '**/*.d.ts',
236
- '**/*.min.js',
237
- '**/*.workspace.*',
238
- ],
239
- },
240
-
241
- ...baseConfig,
242
-
243
- ...importFilesConfig,
244
- importFilesRules,
245
-
246
- ...litA11yFilesConfig,
247
- litA11yFilesRules,
248
-
249
- ...wcFilesConfig,
250
- wcFilesRules,
251
-
252
- ...litFilesConfig,
253
- litFilesRules,
254
-
255
- ...tsFilesConfig,
256
- tsFilesRules,
257
-
258
- ...htmlFilesConfig,
259
- htmlFilesRules,
260
- eslintPluginHtmlConfig,
261
-
262
- eslintConfigPrettier,
263
-
264
- {
265
- settings: {
266
- 'import-x/resolver-next': [createNodeResolver({extensions: ['.js', '.ts']})],
267
- },
268
- },
269
-
270
- {
271
- rules: {
272
- 'no-unused-expressions': ['error', {allowShortCircuit: true, allowTernary: true}],
273
- 'no-empty-function': 'error',
274
- },
275
- },
276
-
277
- {
278
- files: [`**/test/**/*.${fileTypes}`],
279
- rules: {
280
- 'no-unused-expressions': 'off',
281
- },
282
- },
283
- ];
4
+ const eslintConfig = defineConfig(createConfig({tsconfigRootDir: import.meta.dirname}));
5
+ export default eslintConfig;
@@ -12,7 +12,6 @@
12
12
  "type": "module",
13
13
  "scripts": {
14
14
  "analyze": "cem analyze --litelement --globs \"src/**/*.{js,ts}\" \"index.js\"",
15
- "dev:vite": "vite build",
16
15
  "prepare": "husky",
17
16
  "preview:vite": "vite preview",
18
17
  "sort:package": "npx sort-package-json",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "build": "echo \"This is not a TypeScript project, so no need to build.\"",
30
- "build:demo": "npm run dev:vite",
30
+ "build:demo": "vite build",
31
31
  "sass:watch": "sass-style-template"
32
32
  }
33
33
  }
@@ -77,6 +77,10 @@ export const TsWcLitElementPackageMixin = (subclass) =>
77
77
  `${__dirname}/templates/tsconfig.json`,
78
78
  this.destinationPath('tsconfig.json')
79
79
  );
80
+ this.copyTemplate(
81
+ `${__dirname}/templates/tsconfig.build.json`,
82
+ this.destinationPath('tsconfig.build.json')
83
+ );
80
84
  this.copyTemplate(
81
85
  `${__dirname}/templates/vite.lib.config.js`,
82
86
  this.destinationPath('vite.lib.config.js')
@@ -27,9 +27,9 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "build": "npm run build:lib && npm run build:tsc",
30
- "build:demo": "npm run dev:vite",
30
+ "build:demo": "vite build",
31
31
  "build:lib": "vite build --config vite.lib.config.js",
32
- "build:tsc": "tsc",
32
+ "build:tsc": "tsc --project ./tsconfig.build.json",
33
33
  "sass:watch": "sass-style-template -j ts"
34
34
  },
35
35
  "devDependencies": {
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src/"
5
+ },
6
+ "include": [
7
+ "src/**/*.ts"
8
+ ]
9
+ }
@@ -24,7 +24,6 @@
24
24
  "resolveJsonModule": true,
25
25
  "resolvePackageJsonExports": true,
26
26
  "resolvePackageJsonImports": true,
27
- "rootDir": "./src/",
28
27
  "skipLibCheck": true,
29
28
  "sourceMap": true,
30
29
  "strict": true,
@@ -37,6 +36,7 @@
37
36
  "verbatimModuleSyntax": true
38
37
  },
39
38
  "include": [
40
- "src/**/*.ts"
39
+ "src/**/*.ts",
40
+ "test/**/*.ts"
41
41
  ]
42
42
  }