@component-hook/eslint-plugin 0.2.1 → 0.2.2-alpha.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.
Files changed (4) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +120 -120
  3. package/dist/index.js +1 -1
  4. package/package.json +5 -5
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Tzuyi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Tzuyi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,120 +1,120 @@
1
- # @component-hook/eslint-plugin
2
-
3
- A opinionated ESLint config preset for JavaScript, TypeScript, Vue, and Prettier.
4
-
5
- <p>
6
- <a href="https://npm-stat.com/charts.html?package=@component-hook/eslint-plugin">
7
- <img src="https://img.shields.io/npm/dm/@component-hook/eslint-plugin.svg" alt="npm"/>
8
- </a>
9
- <a href="https://www.npmjs.com/package/@component-hook/eslint-plugin">
10
- <img src="https://img.shields.io/npm/v/@component-hook/eslint-plugin.svg" alt="npm"/>
11
- </a>
12
- </p>
13
-
14
- ## Features
15
-
16
- - Support `TypeScript`, `Vue` and `React` out-of-box.
17
- - Built-in `Markdown`, `Prettier`, `Sonarjs`, `Security`, `Playwright` and `Testing-library` configs can be referenced for respective needs.
18
- - Format with Prettier.
19
- - Ignores common files like `dist`, `node_modules`, `coverage`, and files in `.gitignore`.
20
- - Reasonable defaults, best practices, and just a few lines of configuration.
21
-
22
- ## Installation
23
-
24
- ```bash
25
- $ npm install @component-hook/eslint-plugin --save-dev
26
-
27
- # or use yarn
28
- $ yarn add @component-hook/eslint-plugin --dev
29
-
30
- # or use pnpm
31
- $ pnpm install @component-hook/eslint-plugin --save-dev
32
- ```
33
-
34
- Require ESLint >= 9.0.0
35
-
36
- ## Basic Usage
37
-
38
- ```js
39
- import componentHookPlugin from '@component-hook/eslint-plugin';
40
-
41
- export default [
42
- ...componentHookPlugin.configs.basic,
43
- ...componentHookPlugin.configs.vue,
44
- componentHookPlugin.configs.prettier,
45
- ...componentHookPlugin.configs.sonarjs,
46
- componentHookPlugin.configs.security,
47
- ...componentHookPlugin.configs.markdown,
48
- {
49
- files: ['**/__tests__/unit/**/*.test.[jt]s?(x)'],
50
- ...componentHookPlugin.configs['testing-library/vue'],
51
- },
52
- {
53
- files: ['**/__tests__/e2e/**/*.spec.[jt]s?(x)'],
54
- ...componentHookPlugin.configs.playwright,
55
- },
56
- // ...your custom config
57
- ];
58
- ```
59
-
60
- See [basic](./index.ts) and [ignores](./configs/ignores.ts) for more details.
61
-
62
- ## Presets Usage
63
-
64
- ```js
65
- import {
66
- reactPreset, // Includes basic, react, markdown, prettier, sonarjs, security configs
67
- } from '@component-hook/eslint-plugin';
68
-
69
- export default reactPreset;
70
- ```
71
-
72
- ```js
73
- import {
74
- vuePreset, // Includes basic, vue, markdown, prettier, sonarjs, security configs
75
- } from '@component-hook/eslint-plugin';
76
-
77
- export default vuePreset;
78
- ```
79
-
80
- ## Configs
81
-
82
- | Name | Type | Reference |
83
- | ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
84
- | basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-eslint-comments`, `eslint-plugin-import`, `eslint-plugin-unicorn`, `eslint-plugin-regexp` |
85
- | vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
86
- | react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
87
- | markdown | `Linter.Config[]` | `eslint-plugin-markdown/recommended` |
88
- | prettier | `Linter.Config` | `eslint-plugin-prettier/recommended`, `eslint-config-prettier` |
89
- | sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended` |
90
- | security | `Linter.Config` | `eslint-plugin-security/recommended` |
91
- | playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended` |
92
- | testing-library/dom | `Linter.Config` | `eslint-plugin-testing-library/dom` |
93
- | testing-library/vue | `Linter.Config` | `eslint-plugin-testing-library/vue` |
94
- | testing-library/react | `Linter.Config` | `eslint-plugin-testing-library/react` |
95
- | testing-library/angular | `Linter.Config` | `eslint-plugin-testing-library/angular` |
96
- | testing-library/marko | `Linter.Config` | `eslint-plugin-testing-library/marko` |
97
-
98
- ## Reference eslint plugin
99
-
100
- - [eslint-recommended](https://github.com/eslint/eslint/blob/main/packages/js/src/configs/eslint-recommended.js)
101
- - [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
102
- - [eslint-plugin-eslint-comments](https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/lib/configs/recommended.js)
103
- - [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import)
104
- - [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
105
- - [eslint-plugin-regexp/flat/recommended](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/flat/recommended.ts)
106
- - [eslint-plugin-prettier/recommended](https://github.com/prettier/eslint-plugin-prettier/blob/master/recommended.js)
107
- - [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier/blob/main/index.js)
108
- - [eslint-plugin-react/recommended](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/configs/recommended.js)
109
- - [eslint-plugin-react-hooks/recommended](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/index.js)
110
- - [eslint-plugin-jsx-a11y/recommended](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js)
111
- - [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue)
112
- - [eslint-plugin-markdown/recommended](https://github.com/eslint/markdown/blob/main/src/index.js)
113
- - [eslint-plugin-sonarjs/recommended](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/src/index.ts)
114
- - [eslint-plugin-security/recommended](https://github.com/eslint-community/eslint-plugin-security/blob/main/index.js)
115
- - [eslint-plugin-testing-library/dom](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/dom.ts)
116
- - [eslint-plugin-testing-library/vue](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/vue.ts)
117
- - [eslint-plugin-testing-library/react](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/react.ts)
118
- - [eslint-plugin-testing-library/angular](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/angular.ts)
119
- - [eslint-plugin-testing-library/marko](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/marko.ts)
120
- - [eslint-plugin-playwright/flat/recommended](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/src/index.ts)
1
+ # @component-hook/eslint-plugin
2
+
3
+ A opinionated ESLint config preset for JavaScript, TypeScript, Vue, and Prettier.
4
+
5
+ <p>
6
+ <a href="https://npm-stat.com/charts.html?package=@component-hook/eslint-plugin">
7
+ <img src="https://img.shields.io/npm/dm/@component-hook/eslint-plugin.svg" alt="npm"/>
8
+ </a>
9
+ <a href="https://www.npmjs.com/package/@component-hook/eslint-plugin">
10
+ <img src="https://img.shields.io/npm/v/@component-hook/eslint-plugin.svg" alt="npm"/>
11
+ </a>
12
+ </p>
13
+
14
+ ## Features
15
+
16
+ - Support `TypeScript`, `Vue` and `React` out-of-box.
17
+ - Built-in `Markdown`, `Prettier`, `Sonarjs`, `Security`, `Playwright` and `Testing-library` configs can be referenced for respective needs.
18
+ - Format with Prettier.
19
+ - Ignores common files like `dist`, `node_modules`, `coverage`, and files in `.gitignore`.
20
+ - Reasonable defaults, best practices, and just a few lines of configuration.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ $ npm install @component-hook/eslint-plugin --save-dev
26
+
27
+ # or use yarn
28
+ $ yarn add @component-hook/eslint-plugin --dev
29
+
30
+ # or use pnpm
31
+ $ pnpm install @component-hook/eslint-plugin --save-dev
32
+ ```
33
+
34
+ Require ESLint >= 9.0.0
35
+
36
+ ## Basic Usage
37
+
38
+ ```js
39
+ import componentHookPlugin from '@component-hook/eslint-plugin';
40
+
41
+ export default [
42
+ ...componentHookPlugin.configs.basic,
43
+ ...componentHookPlugin.configs.vue,
44
+ componentHookPlugin.configs.prettier,
45
+ ...componentHookPlugin.configs.sonarjs,
46
+ componentHookPlugin.configs.security,
47
+ ...componentHookPlugin.configs.markdown,
48
+ {
49
+ files: ['**/__tests__/unit/**/*.test.[jt]s?(x)'],
50
+ ...componentHookPlugin.configs['testing-library/vue'],
51
+ },
52
+ {
53
+ files: ['**/__tests__/e2e/**/*.spec.[jt]s?(x)'],
54
+ ...componentHookPlugin.configs.playwright,
55
+ },
56
+ // ...your custom config
57
+ ];
58
+ ```
59
+
60
+ See [basic](./index.ts) and [ignores](./configs/ignores.ts) for more details.
61
+
62
+ ## Presets Usage
63
+
64
+ ```js
65
+ import {
66
+ reactPreset, // Includes basic, react, markdown, prettier, sonarjs, security configs
67
+ } from '@component-hook/eslint-plugin';
68
+
69
+ export default reactPreset;
70
+ ```
71
+
72
+ ```js
73
+ import {
74
+ vuePreset, // Includes basic, vue, markdown, prettier, sonarjs, security configs
75
+ } from '@component-hook/eslint-plugin';
76
+
77
+ export default vuePreset;
78
+ ```
79
+
80
+ ## Configs
81
+
82
+ | Name | Type | Reference |
83
+ | ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
84
+ | basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-eslint-comments`, `eslint-plugin-import`, `eslint-plugin-unicorn`, `eslint-plugin-regexp` |
85
+ | vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
86
+ | react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
87
+ | markdown | `Linter.Config[]` | `eslint-plugin-markdown/recommended` |
88
+ | prettier | `Linter.Config` | `eslint-plugin-prettier/recommended`, `eslint-config-prettier` |
89
+ | sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended` |
90
+ | security | `Linter.Config` | `eslint-plugin-security/recommended` |
91
+ | playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended` |
92
+ | testing-library/dom | `Linter.Config` | `eslint-plugin-testing-library/dom` |
93
+ | testing-library/vue | `Linter.Config` | `eslint-plugin-testing-library/vue` |
94
+ | testing-library/react | `Linter.Config` | `eslint-plugin-testing-library/react` |
95
+ | testing-library/angular | `Linter.Config` | `eslint-plugin-testing-library/angular` |
96
+ | testing-library/marko | `Linter.Config` | `eslint-plugin-testing-library/marko` |
97
+
98
+ ## Reference eslint plugin
99
+
100
+ - [eslint-recommended](https://github.com/eslint/eslint/blob/main/packages/js/src/configs/eslint-recommended.js)
101
+ - [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
102
+ - [eslint-plugin-eslint-comments](https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/lib/configs/recommended.js)
103
+ - [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import)
104
+ - [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
105
+ - [eslint-plugin-regexp/flat/recommended](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/flat/recommended.ts)
106
+ - [eslint-plugin-prettier/recommended](https://github.com/prettier/eslint-plugin-prettier/blob/master/recommended.js)
107
+ - [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier/blob/main/index.js)
108
+ - [eslint-plugin-react/recommended](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/configs/recommended.js)
109
+ - [eslint-plugin-react-hooks/recommended](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/index.js)
110
+ - [eslint-plugin-jsx-a11y/recommended](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js)
111
+ - [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue)
112
+ - [eslint-plugin-markdown/recommended](https://github.com/eslint/markdown/blob/main/src/index.js)
113
+ - [eslint-plugin-sonarjs/recommended](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/src/index.ts)
114
+ - [eslint-plugin-security/recommended](https://github.com/eslint-community/eslint-plugin-security/blob/main/index.js)
115
+ - [eslint-plugin-testing-library/dom](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/dom.ts)
116
+ - [eslint-plugin-testing-library/vue](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/vue.ts)
117
+ - [eslint-plugin-testing-library/react](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/react.ts)
118
+ - [eslint-plugin-testing-library/angular](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/angular.ts)
119
+ - [eslint-plugin-testing-library/marko](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/lib/configs/marko.ts)
120
+ - [eslint-plugin-playwright/flat/recommended](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/src/index.ts)
package/dist/index.js CHANGED
@@ -581,7 +581,7 @@ var commentsConfigs = [
581
581
 
582
582
  // configs/sonarjs.ts
583
583
  var plugins2 = {
584
- sonarjs: fixupPluginRules(default12)
584
+ sonarjs: default12
585
585
  };
586
586
  var { settings } = default12.configs.recommended;
587
587
  var sonarjsConfigs = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-hook/eslint-plugin",
3
- "version": "0.2.1",
3
+ "version": "0.2.2-alpha.0",
4
4
  "description": "ESLint config for component hook",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,18 +39,18 @@
39
39
  "eslint-plugin-import": "^2.31.0",
40
40
  "eslint-plugin-jsx-a11y": "^6.10.2",
41
41
  "eslint-plugin-markdown": "^5.1.0",
42
- "eslint-plugin-playwright": "^2.0.1",
42
+ "eslint-plugin-playwright": "^2.1.0",
43
43
  "eslint-plugin-prettier": "^5.2.1",
44
44
  "eslint-plugin-react": "^7.37.2",
45
45
  "eslint-plugin-react-hooks": "^5.0.0",
46
46
  "eslint-plugin-regexp": "^2.7.0",
47
47
  "eslint-plugin-security": "^3.0.1",
48
48
  "eslint-plugin-sonarjs": "^2.0.4",
49
- "eslint-plugin-testing-library": "^6.4.0",
50
- "eslint-plugin-unicorn": "^56.0.0",
49
+ "eslint-plugin-testing-library": "^6.5.0",
50
+ "eslint-plugin-unicorn": "^56.0.1",
51
51
  "eslint-plugin-vue": "^9.31.0",
52
52
  "globals": "^15.12.0",
53
- "typescript-eslint": "^8.14.0",
53
+ "typescript-eslint": "^8.15.0",
54
54
  "vue-eslint-parser": "^9.4.3"
55
55
  },
56
56
  "devDependencies": {