@blockquote/create-wc 1.103.2 → 1.104.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": "1.103.2",
3
+ "version": "1.104.0",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "LitElement",
@@ -45,12 +45,14 @@
45
45
  }
46
46
  },
47
47
  "devDependencies": {
48
- "@open-wc/eslint-config": "^12.0.3",
49
48
  "@html-eslint/eslint-plugin": "^0.27.0",
50
49
  "@html-eslint/parser": "^0.27.0",
51
- "eslint": "^8.57.1",
50
+ "eslint": "^9.12.0",
52
51
  "eslint-config-prettier": "^9.1.0",
53
- "typescript-eslint": "^8.8.1",
52
+ "eslint-plugin-import": "^2.31.0",
53
+ "eslint-plugin-lit": "^1.15.0",
54
+ "eslint-plugin-lit-a11y": "^4.1.4",
55
+ "eslint-plugin-wc": "^2.2.0",
54
56
  "husky": "^9.1.6",
55
57
  "lint-staged": "^15.2.10",
56
58
  "prettier": "^3.3.3",
@@ -1,35 +1,93 @@
1
+ // @ts-nocheck
2
+ import path from 'node:path';
3
+ import {fileURLToPath} from 'node:url';
4
+ import importPlugin from 'eslint-plugin-import';
5
+ import {configs as wc} from 'eslint-plugin-wc';
6
+ import {configs as lit} from 'eslint-plugin-lit';
1
7
  import tseslint from 'typescript-eslint';
8
+ import tsParser from '@typescript-eslint/parser';
2
9
  import html from '@html-eslint/eslint-plugin';
3
10
  import eslintConfigPrettier from 'eslint-config-prettier';
4
- import path from 'node:path';
5
11
  import js from '@eslint/js';
6
- import {fileURLToPath} from 'node:url';
7
12
  import {FlatCompat} from '@eslint/eslintrc';
8
13
 
9
14
  const __filename = fileURLToPath(import.meta.url);
10
15
  const __dirname = path.dirname(__filename);
11
16
 
17
+ const fileTypes = '{js,ts,mjs}';
18
+
12
19
  const compat = new FlatCompat({
13
20
  baseDirectory: __dirname,
14
21
  recommendedConfig: js.configs.recommended,
15
22
  allConfig: js.configs.all,
16
23
  });
17
24
 
18
- const htmlFilesConfig = [html.configs['flat/recommended']].map((conf) => ({
25
+ // eslint-plugin-import
26
+ const importFilesConfig = [
27
+ importPlugin.flatConfigs.recommended,
28
+ importPlugin.flatConfigs.typescript,
29
+ ].map((conf) => ({
19
30
  ...conf,
20
- files: ['**/*.html'],
31
+ files: [`**/*.${fileTypes}`],
32
+ languageOptions: {
33
+ parser: tsParser,
34
+ },
21
35
  }));
22
36
 
23
- const htmlFilesRules = {
24
- files: ['**/*.html'],
37
+ const importFilesRules = {
38
+ files: [`**/*.${fileTypes}`],
25
39
  rules: {
26
- '@html-eslint/indent': ['error', 2],
27
- '@html-eslint/require-closing-tags': 'off',
28
- '@html-eslint/no-extra-spacing-attrs': 'off',
29
- '@html-eslint/attrs-newline': 'off',
40
+ 'import/extensions': [
41
+ 'error',
42
+ 'always',
43
+ {
44
+ ignorePackages: true,
45
+ },
46
+ ],
47
+ 'import/no-extraneous-dependencies': [
48
+ 'error',
49
+ {
50
+ devDependencies: [
51
+ `**/test/**/*.${fileTypes}`,
52
+ `**/*.config.${fileTypes}`,
53
+ `**/*.conf.${fileTypes}`,
54
+ ],
55
+ },
56
+ ],
57
+ 'import/no-unresolved': 'off',
58
+ 'import/prefer-default-export': 'off',
59
+ },
60
+ };
61
+
62
+ // eslint-plugin-wc
63
+ const wcFilesConfig = [wc['flat/recommended']].map((conf) => ({
64
+ ...conf,
65
+ files: [`**/*.${fileTypes}`],
66
+ }));
67
+
68
+ const wcFilesRules = {
69
+ files: [`**/*.${fileTypes}`],
70
+ rules: {
71
+ 'wc/no-constructor-attributes': 'warn',
72
+ },
73
+ };
74
+
75
+ // eslint-plugin-lit
76
+ const litFilesConfig = [lit['flat/recommended']].map((conf) => ({
77
+ ...conf,
78
+ files: [`**/*.${fileTypes}`],
79
+ }));
80
+
81
+ const litFilesRules = {
82
+ files: [`**/*.${fileTypes}`],
83
+ rules: {
84
+ 'lit/lifecycle-super': 'error',
85
+ 'lit/no-native-attributes': 'off',
86
+ 'lit/no-useless-template-literals': 'off',
30
87
  },
31
88
  };
32
89
 
90
+ // @html-eslint/typescript-eslint
33
91
  const tsFilesConfig = [...tseslint.configs.strict, ...tseslint.configs.stylistic].map((conf) => ({
34
92
  ...conf,
35
93
  files: ['**/*.ts'],
@@ -47,34 +105,41 @@ const tsFilesRules = {
47
105
  },
48
106
  };
49
107
 
108
+ // @html-eslint/eslint-plugin
109
+ const htmlFilesConfig = [html.configs['flat/recommended']].map((conf) => ({
110
+ ...conf,
111
+ files: ['**/*.html'],
112
+ }));
113
+
114
+ const htmlFilesRules = {
115
+ files: ['**/*.html'],
116
+ rules: {
117
+ '@html-eslint/indent': ['error', 2],
118
+ '@html-eslint/require-closing-tags': 'off',
119
+ '@html-eslint/no-extra-spacing-attrs': 'off',
120
+ '@html-eslint/attrs-newline': 'off',
121
+ },
122
+ };
123
+
124
+ // eslint-config
50
125
  export default [
51
126
  {
52
127
  ignores: [
53
- '**/.idea',
54
- '**/.vscode',
55
- '**/coverage',
56
- '**/reports',
57
- '**/__snapshots__',
58
- '**/screenshots',
59
- '**/_site',
60
- '**/dist',
61
- '**/dev',
62
- '**/build',
63
- '**/.tmp',
64
- '**/.wireit',
65
- '**/*.d.ts',
66
- '**/storybook-static',
67
- '**/*.config.*',
68
- '**/*.workspace.*',
69
- '**/*.min.js',
70
- '**/*-styles.*',
128
+ '**/{.idea,.vscode,coverage,reports,__snapshots__,screenshots,_site,dist,dev,build,.tmp,.wireit,storybook-static}/**',
129
+ '**/*.{d.ts,min.js,config.*,workspace.*,conf.*,test/**/*}',
71
130
  ],
72
131
  },
73
- ...compat.extends('@open-wc'),
74
- ...htmlFilesConfig,
75
- htmlFilesRules,
132
+ ...compat.extends('plugin:lit-a11y/recommended'),
133
+ ...importFilesConfig,
134
+ importFilesRules,
135
+ ...wcFilesConfig,
136
+ wcFilesRules,
137
+ ...litFilesConfig,
138
+ litFilesRules,
76
139
  ...tsFilesConfig,
77
140
  tsFilesRules,
141
+ ...htmlFilesConfig,
142
+ htmlFilesRules,
78
143
  eslintConfigPrettier,
79
144
  {
80
145
  languageOptions: {
@@ -99,34 +164,14 @@ export default [
99
164
  ignoredNodes: ['PropertyDefinition', 'TemplateLiteral *'],
100
165
  },
101
166
  ],
102
- 'import/extensions': [
103
- 'error',
104
- 'always',
105
- {
106
- ignorePackages: true,
107
- },
108
- ],
109
- 'import/no-extraneous-dependencies': [
110
- 'error',
111
- {
112
- devDependencies: [
113
- '**/test/**/*.{js,ts}',
114
- '**/*.config.{js,ts,mjs,cjs}',
115
- '**/*.conf.{js,ts,mjs,cjs}',
116
- ],
117
- },
118
- ],
119
- 'import/no-unresolved': 'off',
120
- 'import/prefer-default-export': 'off',
121
- 'lit/no-native-attributes': 'off',
122
- 'lit/no-useless-template-literals': 'off',
167
+ 'no-empty-function': 'error',
168
+ 'lit-a11y/no-autofocus': 'off',
123
169
  'lit-a11y/anchor-is-valid': 'off',
124
170
  'lit-a11y/click-events-have-key-events': 'off',
125
- 'lit-a11y/no-autofocus': 'off',
126
171
  },
127
172
  },
128
173
  {
129
- files: ['**/test/**/*.{js,ts}'],
174
+ files: [`**/test/**/*.${fileTypes}`],
130
175
  rules: {
131
176
  'no-unused-expressions': 'off',
132
177
  '@typescript-eslint/no-unused-expressions': 'off',
@@ -39,7 +39,7 @@
39
39
  "concurrently": "^9.0.1",
40
40
  "sort-package-json": "^2.10.1",
41
41
  "ts-lit-plugin": "^2.0.2",
42
- "vite": "^5.4.8"
42
+ "vite": "^5.4.9"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-unused-vars */
2
1
  import { css } from 'lit';
3
2
 
4
3
  export const styles = css`:host {
@@ -32,7 +32,7 @@
32
32
  "sass:watch": "sass-style-template -j ts"
33
33
  },
34
34
  "devDependencies": {
35
- "tslib": "^2.7.0",
35
+ "tslib": "^2.8.0",
36
36
  "typescript": "^5.6.3"
37
37
  }
38
38
  }
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-unused-vars */
2
1
  import { css } from 'lit';
3
2
 
4
3
  export const styles = css`:host {