@component-hook/eslint-plugin 0.1.2-alpha.3 → 0.1.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.
- package/README.md +8 -9
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# @component-hook/eslint-plugin
|
|
2
2
|
|
|
3
|
-
A opinionated ESLint config preset for JavaScript, TypeScript, Vue,
|
|
4
|
-
and Prettier.
|
|
3
|
+
A opinionated ESLint config preset for JavaScript, TypeScript, Vue, and Prettier.
|
|
5
4
|
|
|
6
5
|
<p>
|
|
7
|
-
<a href="https://npm-stat.com/charts.html?package=@component-hook/
|
|
6
|
+
<a href="https://npm-stat.com/charts.html?package=@component-hook/eslint-plugin">
|
|
8
7
|
<img src="https://img.shields.io/npm/dm/@component-hook/eslint-plugin.svg" alt="npm"/>
|
|
9
8
|
</a>
|
|
10
|
-
<a href="https://www.npmjs.com/package/@component-hook/
|
|
9
|
+
<a href="https://www.npmjs.com/package/@component-hook/eslint-plugin">
|
|
11
10
|
<img src="https://img.shields.io/npm/v/@component-hook/eslint-plugin.svg" alt="npm"/>
|
|
12
11
|
</a>
|
|
13
12
|
</p>
|
|
@@ -57,17 +56,17 @@ export default [
|
|
|
57
56
|
];
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
See [basic](./index.ts) for more details.
|
|
59
|
+
See [basic](./index.ts) and [ignores](./configs/ignores.ts) for more details.
|
|
61
60
|
|
|
62
61
|
## Presets Usage
|
|
63
62
|
|
|
64
63
|
```js
|
|
65
64
|
import {
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
reactPreset, // Includes basic, react, markdown, sonarjs, security configs
|
|
66
|
+
vuePreset, // Includes basic, vue, markdown, sonarjs, security configs
|
|
68
67
|
} from '@component-hook/eslint-plugin';
|
|
69
68
|
|
|
70
|
-
export default
|
|
69
|
+
export default reactPreset;
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
## Configs
|
|
@@ -75,7 +74,7 @@ export default reactRecommended;
|
|
|
75
74
|
| Name | Type | Reference |
|
|
76
75
|
| ----------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
77
76
|
| basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-import`, `eslint-plugin-regexp` and `eslint-plugin-prettier` |
|
|
78
|
-
| vue | `Linter.Config[]` | `eslint-plugin-vue`
|
|
77
|
+
| vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
|
|
79
78
|
| react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
|
|
80
79
|
| markdown | `Linter.Config[]` | `eslint-plugin-markdown/recommended` |
|
|
81
80
|
| sonarjs | `Linter.Config` | `eslint-plugin-sonarjs/recommended` |
|
package/dist/index.d.ts
CHANGED
|
@@ -1172,7 +1172,7 @@ declare const _default: {
|
|
|
1172
1172
|
};
|
|
1173
1173
|
};
|
|
1174
1174
|
|
|
1175
|
-
declare const
|
|
1175
|
+
declare const reactPreset: ({
|
|
1176
1176
|
name: string;
|
|
1177
1177
|
rules: {
|
|
1178
1178
|
'no-var': string;
|
|
@@ -2328,7 +2328,7 @@ declare const reactRecommended: ({
|
|
|
2328
2328
|
};
|
|
2329
2329
|
};
|
|
2330
2330
|
})[];
|
|
2331
|
-
declare const
|
|
2331
|
+
declare const vuePreset: ({
|
|
2332
2332
|
name: string;
|
|
2333
2333
|
rules: {
|
|
2334
2334
|
'no-var': string;
|
|
@@ -4648,4 +4648,4 @@ declare const vueSkyline: ({
|
|
|
4648
4648
|
};
|
|
4649
4649
|
})[];
|
|
4650
4650
|
|
|
4651
|
-
export { _default as default,
|
|
4651
|
+
export { _default as default, reactPreset, vuePreset, vueSkyline };
|
package/dist/index.js
CHANGED
|
@@ -363,12 +363,19 @@ var jsConfigs = [
|
|
|
363
363
|
|
|
364
364
|
// configs/typescript.ts
|
|
365
365
|
var rules2 = {
|
|
366
|
-
"@typescript-eslint/no-unused-expressions": "off",
|
|
367
366
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
368
367
|
"@typescript-eslint/no-explicit-any": "off",
|
|
369
368
|
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
370
369
|
"@typescript-eslint/no-shadow": "error",
|
|
371
|
-
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }]
|
|
370
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }],
|
|
371
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
372
|
+
"error",
|
|
373
|
+
{
|
|
374
|
+
allowShortCircuit: true,
|
|
375
|
+
allowTaggedTemplates: true,
|
|
376
|
+
allowTernary: true
|
|
377
|
+
}
|
|
378
|
+
]
|
|
372
379
|
};
|
|
373
380
|
var typescriptConfigs = default4.config({
|
|
374
381
|
extends: [...default4.configs.recommended],
|
|
@@ -410,6 +417,7 @@ var importConfigs = [
|
|
|
410
417
|
name: "component-hook/allow-default-export",
|
|
411
418
|
files: [
|
|
412
419
|
"**/*.d.ts",
|
|
420
|
+
"**/*.md/**",
|
|
413
421
|
`**/*config*.?([cm])[jt]s?(x)`,
|
|
414
422
|
`**/{views,pages,routes,middleware,plugins,api}/**/*.?([cm])[jt]s?(x)`,
|
|
415
423
|
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts`
|
|
@@ -695,6 +703,8 @@ var ignores = {
|
|
|
695
703
|
"**/__snapshots__",
|
|
696
704
|
"**/auto-import?(s).d.ts",
|
|
697
705
|
"**/components.d.ts",
|
|
706
|
+
"**/vite-env.d.ts",
|
|
707
|
+
"**/shims-vue.d.ts",
|
|
698
708
|
"**/.turbo",
|
|
699
709
|
"**/mockServiceWorker.js"
|
|
700
710
|
]
|
|
@@ -734,11 +744,11 @@ var configs2 = {
|
|
|
734
744
|
"testing-library/marko": testingLibraryMarkoConfig
|
|
735
745
|
};
|
|
736
746
|
var eslint_plugin_default = { configs: configs2 };
|
|
737
|
-
var
|
|
738
|
-
var
|
|
739
|
-
var
|
|
747
|
+
var basicPreset = [...markdownConfigs, sonarjsConfig, securityConfig];
|
|
748
|
+
var reactPreset = [...pluginBasic, ...reactConfig, ...basicPreset];
|
|
749
|
+
var vuePreset = [...pluginBasic, ...vueConfigs, ...basicPreset];
|
|
740
750
|
var vueSkyline = [
|
|
741
|
-
...
|
|
751
|
+
...vuePreset,
|
|
742
752
|
{
|
|
743
753
|
files: ["**/*.vue"],
|
|
744
754
|
rules: {
|
|
@@ -752,14 +762,11 @@ var vueSkyline = [
|
|
|
752
762
|
{
|
|
753
763
|
files: ["**/__tests__/e2e/**/*.spec.[jt]s?(x)"],
|
|
754
764
|
...playwrightConfig
|
|
755
|
-
},
|
|
756
|
-
{
|
|
757
|
-
ignores: ["**/vite-env.d.ts"]
|
|
758
765
|
}
|
|
759
766
|
];
|
|
760
767
|
export {
|
|
761
768
|
eslint_plugin_default as default,
|
|
762
|
-
|
|
763
|
-
|
|
769
|
+
reactPreset,
|
|
770
|
+
vuePreset,
|
|
764
771
|
vueSkyline
|
|
765
772
|
};
|