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
My personal ESLint config which extends [standard](https://standardjs.com/) / [semistandard](https://github.com/standard/semistandard) with a couple of extra checks that I find helpful in my projects.
@@ -15,19 +15,21 @@ This package follows [semantic versioning](https://semver.org/). Tightening of a
15
15
16
16
Absolutely, go ahead! I maintain this project as if multiple people are using it. Be sure to give me feedback and if you like it, give me a ping and say so, would make my day 😄
17
17
18
-
## Installation
18
+
## Usage
19
19
20
-
Be sure to install versions of peer dependencies that are valid according to the peer dependency specification of this module.
20
+
### Install
21
21
22
-
As ESLint configs and dependencies can and will change their rules with major releases you will likely get an incorrect ruleset otherwise.
22
+
Be sure to install the correct versions of peer dependencies that this module requires, else you will likely get an incorrect rule setup.
23
23
24
24
To easily install all correct peer dependencies, you can use [`install-peerdeps`](https://www.npmjs.com/package/install-peerdeps):
25
25
26
26
```bash
27
27
install-peerdeps --dev @voxpelli/eslint-config
28
28
```
29
29
30
-
Then add a `.eslintrc` with the following:
30
+
### Configure
31
+
32
+
Add an `.eslintrc`, or other [ESLint configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files), that extends this config:
31
33
32
34
```
33
35
{
@@ -36,6 +38,12 @@ Then add a `.eslintrc` with the following:
36
38
}
37
39
```
38
40
41
+
### Configure, ESM
42
+
43
+
Instead of simply extending `@voxpelli` you can extend `@voxpelli/eslint-config/esm` and get a version of the rules that enforces ESM best practices as well.
44
+
45
+
###
46
+
39
47
## How does this differ from pure [standard](https://standardjs.com/)?
40
48
41
49
*:stop_sign: = changed to `error` level
@@ -96,7 +104,7 @@ Then add a `.eslintrc` with the following:
96
104
*:mute:[`unicorn/numeric-separators-style`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/numeric-separators-style.md) – *deactivated* – currently not enough good support for this in engines
97
105
*:warning:[`unicorn/prefer-add-event-listener`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-add-event-listener.md) – *changed* – set to `warn` instead of `error`
98
106
*:warning:[`unicorn/prefer-event-target`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules//prefer-event-target.md) – *changed* – set to `warn` instead of `error`
99
-
*:warning:[`unicorn/prefer-module`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-module.md) – *changed* – set to `warn` instead of `error`
107
+
*:mute:[`unicorn/prefer-module`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-module.md) – *deactivated* – only useful when you know you're targetting ESM
100
108
*:warning:[`unicorn/prefer-spread`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-spread.md) – *changed* – set to `warn` instead of `error`
101
109
*:mute:[`unicorn/prevent-abbreviations`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prevent-abbreviations.md) – *deactivated* – same as `unicorn/catch-error-name`, I prefer an abbreviated `err` over a non-abbreviated `error`because the latter is too similar to `Error` for my taste
102
110
@@ -116,14 +124,24 @@ Then add a `.eslintrc` with the following:
By extending `@voxpelli/eslint-config/esm` instead of `@voxpelli` you will get these differences:
130
+
131
+
#### :wrench: Overrides of rules
132
+
133
+
*:warning:[`func-style`](https://eslint.org/docs/rules/func-style) – enforces function declarations whenever an arrow function isn't used. Better to do `export function foo () {` than `export const foo = function () {`
134
+
*:stop_sign:[`unicorn/prefer-module`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-module.md) – *changed* – restored to its `plugin:unicorn/recommended` value of `error`
135
+
136
+
119
137
## Alternatives
120
138
121
-
*[eslint-config-rainbow](https://github.com/rainbow-me/eslint-config-rainbow) by [@bcomnes](https://github.com/bcomnes)
*[voxpelli/ghatemplates](https://github.com/voxpelli/ghatemplates) – the templates I use with [`ghat`](https://github.com/fregante/ghat) to update GitHub Actions in my projects
128
-
*[voxpelli/renovate-config-voxpelli](https://github.com/voxpelli/renovate-config-voxpelli) – the shareable [Renovate setup](https://docs.renovatebot.com/config-presets/) I use in my projects
129
-
*[voxpelli/tsconfig](https://github.com/voxpelli/tsconfig) – the shareable `tsconfig.json` setup I use in my projects
145
+
*[`voxpelli/ghatemplates`](https://github.com/voxpelli/ghatemplates) – the templates I use with [`ghat`](https://github.com/fregante/ghat) to update GitHub Actions in my projects
146
+
*[`voxpelli/renovate-config-voxpelli`](https://github.com/voxpelli/renovate-config-voxpelli) – the shareable [Renovate setup](https://docs.renovatebot.com/config-presets/) I use in my projects
147
+
*[`voxpelli/tsconfig`](https://github.com/voxpelli/tsconfig) – the shareable `tsconfig.json` setup I use in my projects
0 commit comments