Skip to content

Commit cf36b08

Browse files
break: rename plugin (#138)
* break: rename plugin * revamp unit tests * update docs * don't check in coverage report * directly build TS * update deps * update readme
1 parent 89d667f commit cf36b08

File tree

134 files changed

+4006
-4772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4006
-4772
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
required: true
1212
- label: I agree to follow the [Code of Conduct](https://github.com/ionic-team/stencil/blob/main/CODE_OF_CONDUCT.md).
1313
required: true
14-
- label: I have searched for [existing issues](https://github.com/stencil-community/stencil-eslint/issues) that already report this problem, without success.
14+
- label: I have searched for [existing issues](https://github.com/stenciljs/eslint-plugin/issues) that already report this problem, without success.
1515
required: true
1616
- type: input
1717
attributes:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
required: true
1212
- label: I agree to follow the [Code of Conduct](https://github.com/ionic-team/stencil/blob/main/CODE_OF_CONDUCT.md).
1313
required: true
14-
- label: I have searched for [existing issues](https://github.com/stencil-community/stencil-eslint/issues) that already include this feature request, without success.
14+
- label: I have searched for [existing issues](https://github.com/stenciljs/eslint-plugin/issues) that already include this feature request, without success.
1515
required: true
1616
- type: textarea
1717
attributes:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ node_modules
55
dist
66
report
77
*.tgz
8+
coverage

README.md

Lines changed: 69 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,17 @@
1-
# @stencil-community/eslint-plugin
1+
# @stencil/eslint-plugin
22

33
ESLint rules specific to Stencil JS projects.
44

55
## Installation
66

7-
If you're using npm v7+, you only need to install this package. Its peer dependencies will be automatically installed.
8-
```bash
9-
npm i --save-dev @stencil-community/eslint-plugin
10-
```
11-
12-
If you're using npm v6 or lower, you will need to install this package and its peer dependencies in your stencil project:
7+
Install this plugin in your project via:
138

149
```bash
15-
npm i --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react @stencil-community/eslint-plugin typescript
10+
npm i --save-dev @stencil/eslint-plugin
1611
```
1712

1813
## Usage
1914

20-
### Configuration (legacy: .eslintrc*)
21-
22-
`.eslintrc.json` configuration file:
23-
24-
```json
25-
{
26-
"parserOptions": {
27-
"project": "./tsconfig.json"
28-
},
29-
"extends": [
30-
"plugin:@stencil-community/recommended"
31-
]
32-
}
33-
```
34-
3515
### Configuration (new: eslint.config.*)
3616

3717
The plugin exports 3 flat configs for use with eslint >= 9:
@@ -40,34 +20,33 @@ The plugin exports 3 flat configs for use with eslint >= 9:
4020
- flat.recommended
4121
- flat.strict
4222

43-
4423
```js
45-
// eslint.config.js
46-
const stencilLint = require('@stencil-community/eslint-plugin');
24+
// eslint.config.mjs
25+
import stencil from '@stencil/eslint-plugin';
4726

48-
module.exports = [
27+
export default [
4928
...
50-
stencilLint.configs.flat.recommended,
29+
stencil.configs.flat.recommended,
5130
...
5231
];
5332
```
5433

5534
Alternatively:
5635

5736
```js
58-
// eslint.config.mjs
59-
import stencilLint from '@stencil-community/eslint-plugin';
37+
// eslint.config.js
38+
const stencil = require('@stencil/eslint-plugin');
6039

61-
export default [
40+
module.exports = [
6241
...
63-
stencilLint.configs.flat.recommended,
42+
stencil.configs.flat.recommended,
6443
...
6544
];
6645
```
6746

68-
6947
By default, ESLint will ignore your `node_modules/` directory. Consider adding a `.eslintignore` file at the root of
7048
your project with any output target directories to avoid false positive errors from ESLint.
49+
7150
```
7251
# place any directories created by the Stencil compilation process here
7352
dist
@@ -76,104 +55,120 @@ www
7655
```
7756

7857
Lint all your project:
79-
```
58+
59+
```sh
8060
npm run lint
8161
```
8262

63+
### Configuration (legacy: .eslintrc*)
64+
65+
`.eslintrc.json` configuration file:
66+
67+
```json
68+
{
69+
"parserOptions": {
70+
"project": "./tsconfig.json"
71+
},
72+
"extends": [
73+
"plugin:stencil/recommended"
74+
]
75+
}
76+
```
77+
8378
## Supported Rules
8479

85-
- [`@stencil-community/async-methods`](./docs/async-methods.md)
80+
- [`stencil/async-methods`](./docs/async-methods.md)
8681

8782
This rule catches Stencil public methods that are not async.
8883

89-
- [`@stencil-community/ban-default-true`](./docs/ban-default-true.md)
84+
- [`stencil/ban-default-true`](./docs/ban-default-true.md)
9085

9186
This rule catches Stencil Props with a default value of `true`.
9287

93-
- [`@stencil-community/ban-prefix`](./docs/ban-prefix.md)
88+
- [`stencil/ban-prefix`](./docs/ban-prefix.md)
9489

9590
This rule catches Stencil Component banned tag name prefix.
9691

97-
- [`@stencil-community/class-pattern`](./docs/class-pattern.md)
92+
- [`stencil/class-pattern`](./docs/class-pattern.md)
9893

9994
This rule catches Stencil Component class name not matching configurable pattern.
10095

101-
- [`@stencil-community/decorators-context`](./docs/decorators-context.md)
96+
- [`stencil/decorators-context`](./docs/decorators-context.md)
10297

10398
This rule catches Stencil decorators in bad locations.
10499

105-
- [`@stencil-community/decorators-style`](./docs/decorators-style.md)
100+
- [`stencil/decorators-style`](./docs/decorators-style.md)
106101

107102
This rule catches Stencil decorators style usage.
108103

109-
- [`@stencil-community/element-type`](./docs/element-type.md)
104+
- [`stencil/element-type`](./docs/element-type.md)
110105

111106
This rule catches Stencil Element decorator have the correct type.
112107

113-
- [`@stencil-community/host-data-deprecated`](./docs/host-data-deprecated.md)
108+
- [`stencil/host-data-deprecated`](./docs/host-data-deprecated.md)
114109

115110
This rule catches Stencil method hostData.
116111

117-
- [`@stencil-community/methods-must-be-public`](./docs/methods-must-be-public.md)
112+
- [`stencil/methods-must-be-public`](./docs/methods-must-be-public.md)
118113

119114
This rule catches Stencil Methods marked as private or protected.
120115

121-
- [`@stencil-community/no-unused-watch`](./docs/no-unused-watch.md)
116+
- [`stencil/no-unused-watch`](./docs/no-unused-watch.md)
122117

123118
This rule catches Stencil Watchs with non existing Props or States.
124119

125-
- [`@stencil-community/own-methods-must-be-private`](./docs/own-methods-must-be-private.md)
120+
- [`stencil/own-methods-must-be-private`](./docs/own-methods-must-be-private.md)
126121

127122
This rule catches own class methods marked as public.
128123

129-
- [`@stencil-community/own-props-must-be-private`](./docs/own-props-must-be-private.md)
124+
- [`stencil/own-props-must-be-private`](./docs/own-props-must-be-private.md)
130125

131126
This rule catches own class properties marked as public.
132127

133-
- [`@stencil-community/prefer-vdom-listener`](./docs/prefer-vdom-listener.md)
128+
- [`stencil/prefer-vdom-listener`](./docs/prefer-vdom-listener.md)
134129

135130
This rule catches Stencil Listen with vdom events.
136131

137-
- [`@stencil-community/props-must-be-public`](./docs/props-must-be-public.md)
132+
- [`stencil/props-must-be-public`](./docs/props-must-be-public.md)
138133

139134
This rule catches Stencil Props marked as private or protected.
140135

141-
- [`@stencil-community/props-must-be-readonly`](./docs/props-must-be-readonly.md)
136+
- [`stencil/props-must-be-readonly`](./docs/props-must-be-readonly.md)
142137

143138
This rule catches Stencil Props marked as non readonly, excluding mutable ones.
144139

145-
- [`@stencil-community/render-returns-host`](./docs/render-returns-host.md)
140+
- [`stencil/render-returns-host`](./docs/render-returns-host.md)
146141

147142
This rule catches Stencil Render returning array instead of Host tag.
148143

149-
- [`@stencil-community/required-jsdoc`](./docs/required-jsdoc.md)
144+
- [`stencil/required-jsdoc`](./docs/required-jsdoc.md)
150145

151146
This rule catches Stencil Props, Methods and Events to define jsdoc.
152147

153-
- [`@stencil-community/required-prefix`](./docs/required-prefix.md)
148+
- [`stencil/required-prefix`](./docs/required-prefix.md)
154149

155150
This rule catches Stencil Component required tag name prefix.
156151

157-
- [`@stencil-community/reserved-member-names`](./docs/reserved-member-names.md)
152+
- [`stencil/reserved-member-names`](./docs/reserved-member-names.md)
158153

159154
This rule catches Stencil Prop names that share names of Global HTML Attributes.
160155

161-
- [`@stencil-community/single-export`](./docs/single-export.md)
156+
- [`stencil/single-export`](./docs/single-export.md)
162157

163158
This rule catches modules that expose more than just the Stencil Component itself.
164159

165-
- [`@stencil-community/strict-mutable`](./docs/strict-mutable.md)
160+
- [`stencil/strict-mutable`](./docs/strict-mutable.md)
166161

167162
This rule catches Stencil Prop marked as mutable but not changing value in code.
168163

169164
## Recommended rules
170165

171166
```json
172167
{
173-
"@stencil-community/async-methods": "error",
174-
"@stencil-community/ban-prefix": ["error", ["stencil", "stnl", "st"]],
175-
"@stencil-community/decorators-context": "error",
176-
"@stencil-community/decorators-style": [
168+
"stencil/async-methods": "error",
169+
"stencil/ban-prefix": ["error", ["stencil", "stnl", "st"]],
170+
"stencil/decorators-context": "error",
171+
"stencil/decorators-style": [
177172
"error", {
178173
"prop": "inline",
179174
"state": "inline",
@@ -183,20 +178,20 @@ This rule catches Stencil Prop marked as mutable but not changing value in code.
183178
"watch": "multiline",
184179
"listen": "multiline"
185180
}],
186-
"@stencil-community/element-type": "error",
187-
"@stencil-community/host-data-deprecated": "error",
188-
"@stencil-community/methods-must-be-public": "error",
189-
"@stencil-community/no-unused-watch": "error",
190-
"@stencil-community/own-methods-must-be-private": "error",
191-
"@stencil-community/own-props-must-be-private": "error",
192-
"@stencil-community/prefer-vdom-listener": "error",
193-
"@stencil-community/props-must-be-public": "error",
194-
"@stencil-community/props-must-be-readonly": "error",
195-
"@stencil-community/render-returns-host": "error",
196-
"@stencil-community/required-jsdoc": "error",
197-
"@stencil-community/reserved-member-names": "error",
198-
"@stencil-community/single-export": "error",
199-
"@stencil-community/strict-mutable": "error"
181+
"stencil/element-type": "error",
182+
"stencil/host-data-deprecated": "error",
183+
"stencil/methods-must-be-public": "error",
184+
"stencil/no-unused-watch": "error",
185+
"stencil/own-methods-must-be-private": "error",
186+
"stencil/own-props-must-be-private": "error",
187+
"stencil/prefer-vdom-listener": "error",
188+
"stencil/props-must-be-public": "error",
189+
"stencil/props-must-be-readonly": "error",
190+
"stencil/render-returns-host": "error",
191+
"stencil/required-jsdoc": "error",
192+
"stencil/reserved-member-names": "error",
193+
"stencil/single-export": "error",
194+
"stencil/strict-mutable": "error"
200195
}
201196
```
202197

@@ -211,4 +206,4 @@ All contributions welcome.
211206

212207
## License
213208

214-
- [MIT](https://raw.githubusercontent.com/stencil-community/stencil/main/LICENSE)
209+
- [MIT](https://raw.githubusercontent.com/stenciljs/eslint-plugin/refs/heads/main/LICENSE.md)

docs/async-methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ No config is needed
99
## Usage
1010

1111
```json
12-
{ "@stencil-community/async-methods": "error" }
12+
{ "stencil/async-methods": "error" }
1313
```
1414

1515
> Fix included

docs/ban-default-true.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ No config is needed
99
## Usage
1010

1111
```json
12-
{ "@stencil-community/ban-default-true": "error" }
12+
{ "stencil/ban-default-true": "error" }
1313
```
1414

1515

docs/ban-prefix.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ An array of `"string"`s which no Component `tag` will be allowed to use as a pre
99
### Config examples
1010

1111
```json
12-
{ "@stencil-community/ban-prefix": ["error", ["stencil"]] }
12+
{ "stencil/ban-prefix": ["error", ["stencil"]] }
1313
```
1414

1515
```json
16-
{ "@stencil-community/ban-prefix": ["error", ["stencil", "st", "stnl"]] }
16+
{ "stencil/ban-prefix": ["error", ["stencil", "st", "stnl"]] }
1717
```
1818

1919
## Schema

docs/class-pattern.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ An object containing:
1212
### Config examples
1313

1414
```json
15-
{ "@stencil-community/class-pattern": ["error", { "pattern": "^(?!NoStart).*Component$", "ignoreCase": true }] }
15+
{ "stencil/class-pattern": ["error", { "pattern": "^(?!NoStart).*Component$", "ignoreCase": true }] }
1616
```
1717

1818
## Schema

docs/decorators-context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ No config is needed
99
## Usage
1010

1111
```json
12-
{ "@stencil-community/decorators-context": "error" }
12+
{ "stencil/decorators-context": "error" }
1313
```

docs/decorators-style.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If decorators are composed (multiple decorators for a single declaration), "mult
1818
### Config examples
1919

2020
```json
21-
{ "@stencil-community/decorators-style": ["error", { "prop": "inline", "method": "multiline" }] }
21+
{ "stencil/decorators-style": ["error", { "prop": "inline", "method": "multiline" }] }
2222
```
2323

2424
## Schema

0 commit comments

Comments
 (0)