You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -6,26 +6,26 @@ Thanks for your interest in helping out! Here are a **few** _weird_ tricks to ~~
6
6
7
7
When opening an [issue](#issues):
8
8
9
-
-[ ] search open/closed issues
10
-
-[ ] discuss bug/enhancement in new or old issue
9
+
-[ ] search open/closed issues
10
+
-[ ] discuss bug/enhancement in new or old issue
11
11
12
12
[PR](#prs) time:
13
13
14
-
-[ ] write tests
15
-
-[ ] implement feature/fix bug
16
-
-[ ] update docs
17
-
-[ ] make a note in change log
14
+
-[ ] write tests
15
+
-[ ] implement feature/fix bug
16
+
-[ ] update docs
17
+
-[ ] make a note in change log
18
18
19
19
Remember, you don't need to do it all yourself; any of these are helpful! 😎
20
20
21
21
## How to get started
22
22
23
23
If you are new to `eslint`, below are a few resources that will help you to familiarize yourself with the project.
24
24
25
-
- Watch [this presentation](https://www.youtube.com/watch?v=2W9tUnALrLg) to learn the fundamental concept of Abstract Syntax Trees (AST) and the way `eslint` works under the hood.
26
-
- Familiarize yourself with the [AST explorer](https://astexplorer.net/) tool. Look into rules in `docs/rules`, create patterns in the rules, then analyze its AST.
27
-
- Explore the blog posts on how to create a custom rule. [One blog post](https://blog.yonatan.dev/writing-a-custom-eslint-rule-to-spot-undeclared-props/). [Second blog post](https://betterprogramming.pub/creating-custom-eslint-rules-cdc579694608).
28
-
- Read the official `eslint`[developer guide](https://eslint.org/docs/latest/developer-guide/architecture/).
25
+
- Watch [this presentation](https://www.youtube.com/watch?v=2W9tUnALrLg) to learn the fundamental concept of Abstract Syntax Trees (AST) and the way `eslint` works under the hood.
26
+
- Familiarize yourself with the [AST explorer](https://astexplorer.net/) tool. Look into rules in `docs/rules`, create patterns in the rules, then analyze its AST.
27
+
- Explore the blog posts on how to create a custom rule. [One blog post](https://blog.yonatan.dev/writing-a-custom-eslint-rule-to-spot-undeclared-props/). [Second blog post](https://betterprogramming.pub/creating-custom-eslint-rules-cdc579694608).
28
+
- Read the official `eslint`[developer guide](https://eslint.org/docs/latest/developer-guide/architecture/).
With the advent of module bundlers and the current state of modules and module
160
160
syntax specs, it's not always obvious where `import x from 'module'` should look
@@ -175,7 +175,7 @@ resolvers are just npm packages, so [third party packages are supported](https:/
175
175
176
176
You can reference resolvers in several ways (in order of precedence):
177
177
178
-
- as a conventional `eslint-import-resolver` name, like `eslint-import-resolver-foo`:
178
+
- as a conventional `eslint-import-resolver` name, like `eslint-import-resolver-foo`:
179
179
180
180
```yaml
181
181
# .eslintrc.yml
@@ -195,7 +195,7 @@ module.exports = {
195
195
}
196
196
```
197
197
198
-
- with a full npm module name, like `my-awesome-npm-module`:
198
+
- with a full npm module name, like `my-awesome-npm-module`:
199
199
200
200
```yaml
201
201
# .eslintrc.yml
@@ -214,7 +214,7 @@ module.exports = {
214
214
}
215
215
```
216
216
217
-
- with a filesystem path to resolver, defined in this example as a `computed property` name:
217
+
- with a filesystem path to resolver, defined in this example as a `computed property` name:
218
218
219
219
```js
220
220
// .eslintrc.js
@@ -336,11 +336,11 @@ If you are using `yarn` PnP as your package manager, add the `.yarn` folder and
336
336
337
337
Each item in this array is either a folder's name, its subpath, or its absolute prefix path:
338
338
339
-
- `jspm_modules`will match any file or folder named `jspm_modules` or which has a direct or non-direct parent named `jspm_modules`, e.g. `/home/me/project/jspm_modules` or `/home/me/project/jspm_modules/some-pkg/index.js`.
339
+
- `jspm_modules`will match any file or folder named `jspm_modules` or which has a direct or non-direct parent named `jspm_modules`, e.g. `/home/me/project/jspm_modules` or `/home/me/project/jspm_modules/some-pkg/index.js`.
340
340
341
-
- `packages/core`will match any path that contains these two segments, for example `/home/me/project/packages/core/src/utils.js`.
341
+
- `packages/core`will match any path that contains these two segments, for example `/home/me/project/packages/core/src/utils.js`.
342
342
343
-
- `/home/me/project/packages`will only match files and directories inside this directory, and the directory itself.
343
+
- `/home/me/project/packages`will only match files and directories inside this directory, and the directory itself.
344
344
345
345
Please note that incomplete names are not allowed here so `components` won't match `bower_components` and `packages/ui` won't match `packages/ui-utils` (but will match `packages/ui/utils`).
Copy file name to clipboardExpand all lines: docs/rules/consistent-type-specifier-style.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,8 @@ This rule includes a fixer that will automatically convert your specifiers to th
37
37
38
38
The rule accepts a single string option which may be one of:
39
39
40
-
-`'prefer-inline'` - enforces that named type-only specifiers are only ever written with an inline marker; and never as part of a top-level, type-only import.
41
-
-`'prefer-top-level'` - enforces that named type-only specifiers only ever written as part of a top-level, type-only import; and never with an inline marker.
40
+
-`'prefer-inline'` - enforces that named type-only specifiers are only ever written with an inline marker; and never as part of a top-level, type-only import.
41
+
-`'prefer-top-level'` - enforces that named type-only specifiers only ever written as part of a top-level, type-only import; and never with an inline marker.
42
42
43
43
By default the rule will use the `prefer-inline` option.
Copy file name to clipboardExpand all lines: docs/rules/dynamic-import-chunkname.md
+5
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,10 @@ This rule reports any dynamic imports without a webpackChunkName specified in a
7
7
This rule enforces naming of webpack chunks in dynamic imports. When you don't explicitly name chunks, webpack will autogenerate chunk names that are not consistent across builds, which prevents long-term browser caching.
8
8
9
9
## Rule Details
10
+
10
11
This rule runs against `import()` by default, but can be configured to also run against an alternative dynamic-import function, e.g. 'dynamicImport.'
11
12
You can also configure the regex format you'd like to accept for the webpackChunkName - for example, if we don't want the number 6 to show up in our chunk names:
13
+
12
14
```javascript
13
15
{
14
16
"dynamic-import-chunkname": [2, {
@@ -19,6 +21,7 @@ You can also configure the regex format you'd like to accept for the webpackChun
Copy file name to clipboardExpand all lines: docs/rules/exports-last.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@
4
4
5
5
This rule enforces that all exports are declared at the bottom of the file. This rule will report any export declarations that comes before any non-export statements.
6
6
7
-
8
7
## This will be reported
9
8
10
9
```JS
@@ -45,7 +44,7 @@ export const str = 'foo'
45
44
46
45
If you don't mind exports being sprinkled throughout a file, you may not want to enable this rule.
47
46
48
-
####ES6 exports only
47
+
### ES6 exports only
49
48
50
49
The exports-last rule is currently only working on ES6 exports. You may not want to enable this rule if you're using CommonJS exports.
Copy file name to clipboardExpand all lines: docs/rules/extensions.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,13 @@ In order to provide a consistent use of file extensions across your code base, t
10
10
11
11
This rule either takes one string option, one object option, or a string and an object option. If it is the string `"never"` (the default value), then the rule forbids the use for any extension. If it is the string `"always"`, then the rule enforces the use of extensions for all import statements. If it is the string `"ignorePackages"`, then the rule enforces the use of extensions for all import statements except package imports.
@@ -26,7 +26,7 @@ By providing an object you can configure each extension separately.
26
26
27
27
By providing both a string and an object, the string will set the default setting for all extensions, and the object can be used to set granular overrides for specific extensions.
28
28
29
-
```
29
+
```json
30
30
"import/extensions": [
31
31
<severity>,
32
32
"never"| "always" | "ignorePackages",
@@ -40,7 +40,7 @@ For example, `["error", "never", { "svg": "always" }]` would require that all ex
40
40
41
41
`ignorePackages` can be set as a separate boolean option like this:
42
42
43
-
```
43
+
```json
44
44
"import/extensions": [
45
45
<severity>,
46
46
"never"| "always" | "ignorePackages",
@@ -62,7 +62,7 @@ When disallowing the use of certain extensions this rule makes an exception and
62
62
63
63
For example, given the following folder structure:
0 commit comments