@zipify/wysiwyg 4.9.1 → 4.9.2

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.
@@ -12,11 +12,16 @@ inputs:
12
12
  runs:
13
13
  using: "composite"
14
14
  steps:
15
- - run: npx eslint --config .eslintrc.js --output-file ./eslint_report.json --format json ${{ inputs.files }}
15
+ - run: npx oxlint --config .oxlintrc.json --tsconfig tsconfig.lint.json -f github ${{ inputs.files }}
16
16
  shell: sh
17
17
 
18
- - uses: ataylorme/eslint-annotate-action@1.2.0
18
+ - name: eslint
19
+ run: npx eslint --config eslint.config.mjs --output-file ./eslint_report.json --format json ${{ inputs.files }}
20
+ if: ${{ always() }}
21
+ shell: sh
22
+
23
+ - uses: ataylorme/eslint-annotate-action@v3
19
24
  if: ${{ always() }}
20
25
  with:
21
- repo-token: ${{ inputs.github-token }}
26
+ GITHUB_TOKEN: ${{ inputs.github-token }}
22
27
  report-json: ./eslint_report.json
@@ -0,0 +1,32 @@
1
+ import { ESLint } from 'eslint'
2
+ import eslintConfig from './eslint.config.mjs';
3
+
4
+ const eslint = new ESLint({
5
+ overrideConfigFile: true,
6
+ overrideConfig: eslintConfig
7
+ })
8
+
9
+ async function applyEslintIgnore(filenames) {
10
+ const isIgnored = await Promise.all(filenames.map((file) => eslint.isPathIgnored(file)))
11
+ const filteredFiles = filenames.filter((_, index) => !isIgnored[index])
12
+ return filteredFiles.join(' ')
13
+ }
14
+
15
+ export default {
16
+ '*.{vue,css}': 'stylelint --allow-empty-input --fix --config stylelint.config.mjs',
17
+
18
+ '*.{vue,js,ts}': async (filenames) => {
19
+ const filtered = await applyEslintIgnore(filenames);
20
+
21
+ if (filtered.length === 0) {
22
+ return [];
23
+ }
24
+
25
+ return [
26
+ `zipify-lint-js --oxlint-tsconfig ./tsconfig.lint.json --fix ${filtered}`,
27
+ `jest --passWithNoTests --findRelatedTests ${filtered}`
28
+ ]
29
+ },
30
+
31
+ '*.svg': 'svgo --config ./config/svgo.js',
32
+ };
package/.oxlintrc.json ADDED
@@ -0,0 +1,185 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["import"],
4
+ "env": {
5
+ "browser": true,
6
+ "node": true
7
+ },
8
+ "ignorePatterns": [
9
+ "dist/**"
10
+ ],
11
+ "categories": {
12
+ "correctness": "error",
13
+ "suspicious": "error",
14
+ "restriction": "error"
15
+ },
16
+ "rules": {
17
+ "default-case": "off",
18
+ "default-param-last": "error",
19
+ "eqeqeq": ["warn", "smart"],
20
+ "guard-for-in": "off",
21
+ "import/default": "error",
22
+ "import/exports": "off",
23
+ "import/extensions": [
24
+ "error",
25
+ "never",
26
+ {
27
+ "scss": "always",
28
+ "html": "always",
29
+ "json": "always"
30
+ }
31
+ ],
32
+ "import/first": "error",
33
+ "import/named": "off",
34
+ "import/namespace": "error",
35
+ "import/newline-after-import": "error",
36
+ "import/no-absolute-path": "error",
37
+ "import/no-cycle": "warn",
38
+ "import/no-default-export": "off",
39
+ "import/no-deprecated": "warn",
40
+ "import/no-dynamic-require": "off",
41
+ "import/no-namespace": "error",
42
+ "import/no-self-import": "error",
43
+ "import/no-useless-path-segments": "error",
44
+ "import/order": [
45
+ "error",
46
+ {
47
+ "pathGroups": [
48
+ {
49
+ "pattern": "@/**",
50
+ "group": "external"
51
+ }
52
+ ],
53
+ "groups": [
54
+ "builtin",
55
+ "external",
56
+ "internal",
57
+ "parent",
58
+ "sibling"
59
+ ]
60
+ }
61
+ ],
62
+ "import/unambiguous": "off",
63
+ "max-params": ["error", 4],
64
+ "no-alert": "off",
65
+ "no-console": [
66
+ "error",
67
+ {
68
+ "allow": ["warn", "error", "assert"]
69
+ }
70
+ ],
71
+ "no-duplicate-imports": "error",
72
+ "no-empty-function": "off",
73
+ "no-eq-null": "off",
74
+ "no-extend-native": "error",
75
+ "no-new": "off",
76
+ "no-plusplus": "off",
77
+ "no-prototype-builtins": "off",
78
+ "no-restricted-imports": [
79
+ "error",
80
+ {
81
+ "patterns": [
82
+ {
83
+ "group": ["@vue/*", "vue"],
84
+ "importNames": ["defineProps", "defineEmits"],
85
+ "message": "'defineProps' and 'defineEmits' is compiler-time functions and should not be imported"
86
+ }
87
+ ]
88
+ }
89
+ ],
90
+ "no-restricted-syntax": [
91
+ "error",
92
+ {
93
+ "selector": "PropertyDefinition[key.type=\"PrivateIdentifier\"]",
94
+ "message": "Native private fields breaks vue3 reactivity"
95
+ },
96
+ {
97
+ "selector": "MethodDefinition[key.type=\"PrivateIdentifier\"]",
98
+ "message": "Native private methods breaks vue3 reactivity"
99
+ }
100
+ ],
101
+ "no-self-compare": "error",
102
+ "no-undefined": "off",
103
+ "no-unused-expressions": "off",
104
+ "no-unused-vars": [
105
+ "warn",
106
+ {
107
+ "vars": "local",
108
+ "args": "after-used"
109
+ }
110
+ ],
111
+ "no-useless-concat": "error",
112
+ "no-void": "off"
113
+ },
114
+ "overrides": [
115
+ {
116
+ "files": ["*.ts", "*.vue"],
117
+ "plugins": ["typescript"],
118
+ "rules": {
119
+ "@typescript-eslint/ban-types": "off",
120
+ "@typescript-eslint/explicit-member-accessibility": [
121
+ "error",
122
+ {
123
+ "accessibility": "no-public"
124
+ }
125
+ ],
126
+ "@typescript-eslint/no-empty-function": "off",
127
+ "@typescript-eslint/no-empty-interface": "off",
128
+ "@typescript-eslint/no-explicit-any": "error",
129
+ "@typescript-eslint/no-non-null-assertion": "off",
130
+ "import/extensions": [
131
+ "error",
132
+ "never",
133
+ {
134
+ "scss": "always",
135
+ "html": "always",
136
+ "json": "always",
137
+ "vue": "always"
138
+ }
139
+ ],
140
+ "no-duplicate-imports": "off",
141
+ "no-undef": "off"
142
+ }
143
+ },
144
+ {
145
+ "files": ["*.ts"],
146
+ "rules": {
147
+ "@typescript-eslint/explicit-function-return-type": [
148
+ "error",
149
+ {
150
+ "allowExpressions": true,
151
+ "allowTypedFunctionExpressions": true
152
+ }
153
+ ]
154
+ }
155
+ },
156
+ {
157
+ "files": ["*.vue"],
158
+ "rules": {
159
+ "@typescript-eslint/explicit-function-return-type": "off",
160
+ "import/extensions": "off",
161
+ "import/no-cycle": "error"
162
+ }
163
+ },
164
+ {
165
+ "files": ["*.test.ts", "*.test.js"],
166
+ "plugins": ["jest"],
167
+ "rules": {
168
+ "jest/consistent-test-it": ["error", { "fn": "test", "withinDescribe": "test" }],
169
+ "jest/no-alias-methods": "off",
170
+ "jest/no-duplicate-hooks": "error",
171
+ "jest/no-test-return-statement": "error",
172
+ "jest/prefer-comparison-matcher": "error",
173
+ "jest/prefer-equality-matcher": "error",
174
+ "jest/prefer-hooks-in-order": "error",
175
+ "jest/prefer-hooks-on-top": "error",
176
+ "jest/prefer-spy-on": "error",
177
+ "jest/prefer-to-be": "error",
178
+ "jest/prefer-to-contain": "error",
179
+ "jest/prefer-to-have-length": "error",
180
+ "jest/require-hook": "error",
181
+ "jest/require-to-throw-message": "error"
182
+ }
183
+ }
184
+ ]
185
+ }