eslint-config-webpack 1.2.4 → 4.0.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.
- package/README.md +19 -49
- package/configs/browser.js +20 -0
- package/configs/index.js +19 -0
- package/configs/javascript.js +1257 -0
- package/configs/jest.js +195 -0
- package/configs/markdown.js +61 -0
- package/configs/node.js +222 -0
- package/configs/stylistic.js +77 -0
- package/configs/typescript.js +257 -0
- package/configs.js +208 -0
- package/index.js +3 -21
- package/package.json +57 -18
- package/CHANGELOG.md +0 -101
- package/rules/best-practices.js +0 -318
- package/rules/es2015.js +0 -173
- package/rules/imports.js +0 -200
- package/rules/node.js +0 -49
- package/rules/possible-errors.js +0 -131
- package/rules/stylistic-issues.js +0 -429
- package/rules/variables.js +0 -51
package/README.md
CHANGED
|
@@ -1,74 +1,44 @@
|
|
|
1
1
|
[![npm][npm]][npm-url]
|
|
2
|
-
[![deps][deps]][deps-url]
|
|
3
2
|
[![test][test]][test-url]
|
|
4
|
-
[![
|
|
5
|
-
[![chat][chat]][chat-url]
|
|
3
|
+
[](https://github.com/webpack/webpack/discussions)
|
|
6
4
|
|
|
7
5
|
<div align="center">
|
|
8
6
|
<!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->
|
|
9
7
|
<img width="200" height="200"
|
|
10
8
|
src="https://cdn.worldvectorlogo.com/logos/eslint.svg">
|
|
11
9
|
<a href="https://github.com/webpack/webpack">
|
|
12
|
-
<img width="200" height="200"
|
|
13
|
-
src="https://worldvectorlogo.com/logos/webpack.svg">
|
|
10
|
+
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
|
|
14
11
|
</a>
|
|
15
12
|
<h1>ESLint Config Webpack</h1>
|
|
16
|
-
<p>Provides Webpacks's
|
|
13
|
+
<p>Provides Webpacks's eslint config as an extensible shared config.<p>
|
|
17
14
|
</div>
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
# eslint-config-webpack
|
|
17
|
+
|
|
18
|
+
## Install
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
21
|
npm i -D eslint-config-webpack
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Webpack's eslint config contains all of our ESLint rules, including ECMAScript 6+ and is similar to [Airbnb's ESLint base rules](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base). It requires `eslint` and `eslint-plugin-import`.
|
|
24
|
+
## Usage
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
Webpack's eslint config contains all of our ESLint rules.
|
|
30
27
|
|
|
31
|
-
_In your .
|
|
28
|
+
_In your eslint.config.js add ..._
|
|
32
29
|
|
|
33
30
|
```js
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
import { defineConfig } from "eslint/config";
|
|
32
|
+
import config from "eslint-config-webpack";
|
|
33
|
+
|
|
34
|
+
export default defineConfig([
|
|
35
|
+
{
|
|
36
|
+
extends: [config]
|
|
37
|
+
}
|
|
38
|
+
]);
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
<h2 align="center">Maintainers</h2>
|
|
40
|
-
|
|
41
|
-
<table>
|
|
42
|
-
<tbody>
|
|
43
|
-
<tr>
|
|
44
|
-
<td align="center">
|
|
45
|
-
<img width="150" height="150"
|
|
46
|
-
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150">
|
|
47
|
-
</br>
|
|
48
|
-
<a href="https://github.com/d3viant0ne">Joshua Wiens</a>
|
|
49
|
-
</td>
|
|
50
|
-
<td align="center">
|
|
51
|
-
<img width="150" height="150"
|
|
52
|
-
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150">
|
|
53
|
-
</br>
|
|
54
|
-
<a href="https://github.com/bebraw">Juho Vepsäläinen</a>
|
|
55
|
-
</td>
|
|
56
|
-
</tr>
|
|
57
|
-
<tbody>
|
|
58
|
-
</table>
|
|
59
|
-
|
|
60
|
-
|
|
61
41
|
[npm]: https://img.shields.io/npm/v/eslint-config-webpack.svg
|
|
62
42
|
[npm-url]: https://npmjs.com/package/eslint-config-webpack
|
|
63
|
-
|
|
64
|
-
[
|
|
65
|
-
[deps-url]: https://david-dm.org/webpack-contrib/eslint-config-webpack
|
|
66
|
-
|
|
67
|
-
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
|
|
68
|
-
[chat-url]: https://gitter.im/webpack/webpack
|
|
69
|
-
|
|
70
|
-
[test]: http://img.shields.io/travis/webpack-contrib/eslint-config-webpack.svg
|
|
71
|
-
[test-url]: https://travis-ci.org/webpack-contrib/eslint-config-webpack
|
|
72
|
-
|
|
73
|
-
[cover]: https://coveralls.io/repos/github/webpack-contrib/eslint-config-webpack/badge.svg?branch=master
|
|
74
|
-
[cover-url]: https://coveralls.io/github/webpack-contrib/eslint-config-webpack?branch=master
|
|
43
|
+
[test]: https://github.com/webpack/eslint-config-webpack/actions/workflows/test.yml/badge.svg
|
|
44
|
+
[test-url]: https://github.com/webpack/eslint-config-webpack/actions/workflows/test.yml
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import importPlugin from "eslint-plugin-import";
|
|
3
|
+
|
|
4
|
+
const recommendedBrowserConfig = {
|
|
5
|
+
languageOptions: {
|
|
6
|
+
globals: {
|
|
7
|
+
...globals.browser,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
plugins: {
|
|
11
|
+
import: importPlugin,
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"import/extensions": ["error", "always", { ignorePackages: true }],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
"browser/recommended": recommendedBrowserConfig,
|
|
20
|
+
};
|
package/configs/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import browserConfig from "./browser.js";
|
|
2
|
+
import javascriptConfig from "./javascript.js";
|
|
3
|
+
import jestConfig from "./jest.js";
|
|
4
|
+
import markdownConfig from "./markdown.js";
|
|
5
|
+
import nodeConfig from "./node.js";
|
|
6
|
+
import stylisticConfig from "./stylistic.js";
|
|
7
|
+
import typescriptConfig from "./typescript.js";
|
|
8
|
+
|
|
9
|
+
const configs = {
|
|
10
|
+
...browserConfig,
|
|
11
|
+
...javascriptConfig,
|
|
12
|
+
...jestConfig,
|
|
13
|
+
...markdownConfig,
|
|
14
|
+
...nodeConfig,
|
|
15
|
+
...stylisticConfig,
|
|
16
|
+
...typescriptConfig,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default configs;
|