@jgarber/eslint-config 0.2.0 → 1.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/LICENSE +1 -1
- package/README.md +36 -1
- package/eslint.config.js +32 -0
- package/index.js +1 -22
- package/package.json +9 -5
- package/eleventy.js +0 -16
- package/module.js +0 -17
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
1
|
# eslint-config
|
|
2
2
|
|
|
3
|
-
Shareable [ESLint](https://eslint.org)
|
|
3
|
+
Shareable [ESLint](https://eslint.org) configuration.
|
|
4
|
+
|
|
5
|
+
> **Note**
|
|
6
|
+
> As of v1.0.0, this shareable configuration uses ESLint's new "flat" configuration file format and, thus, may not be suitable for every project. See [the official documentation](https://eslint.org/docs/latest/use/configure/configuration-files-new) for details.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install --save-dev @jgarber/eslint-config
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Using [CommonJS module](https://nodejs.org/api/modules.html) syntax:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
// eslint.config.js
|
|
20
|
+
module.exports = require('@jgarber/eslint-config');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Using [ECMAScript module (ESM)](https://nodejs.org/api/esm.html) syntax:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
// eslint.config.js
|
|
27
|
+
import config from '@jgarber/eslint-config';
|
|
28
|
+
|
|
29
|
+
export default [
|
|
30
|
+
...config,
|
|
31
|
+
{
|
|
32
|
+
files: ['**/*.js'],
|
|
33
|
+
languageOptions: {
|
|
34
|
+
sourceType: 'module'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
```
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Import Standard's ESLint configurtation for use with ESLint's new "flat"
|
|
3
|
+
* configuration file format.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link https://github.com/standard/eslint-config-standard/blob/master/.eslintrc.json}
|
|
6
|
+
* @see {@link https://eslint.org/docs/latest/use/configure/configuration-files-new}
|
|
7
|
+
*/
|
|
8
|
+
const standard = require('eslint-config-standard');
|
|
9
|
+
|
|
10
|
+
module.exports = [
|
|
11
|
+
{
|
|
12
|
+
plugins: Object.fromEntries(standard.plugins.map(plugin => [plugin, require(`eslint-plugin-${plugin}`)])),
|
|
13
|
+
rules: {
|
|
14
|
+
...standard.rules,
|
|
15
|
+
|
|
16
|
+
// Enforces consistent use of semicolons.
|
|
17
|
+
semi: ['error', 'always']
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
/*
|
|
22
|
+
* By default, ESLint's "flat" config considers `*.js` files as ECMAScript
|
|
23
|
+
* modules (ESM). Instead, consider `*.js` files to be CommonJS modules.
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://eslint.org/docs/latest/use/configure/configuration-files-new#configuration-objects}
|
|
26
|
+
*/
|
|
27
|
+
files: ['**/*.js'],
|
|
28
|
+
languageOptions: {
|
|
29
|
+
sourceType: 'commonjs'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
];
|
package/index.js
CHANGED
|
@@ -1,22 +1 @@
|
|
|
1
|
-
module.exports =
|
|
2
|
-
extends: 'eslint:recommended',
|
|
3
|
-
|
|
4
|
-
rules: {
|
|
5
|
-
// Enforces consistent use of trailing commas in object and array literals.
|
|
6
|
-
'comma-dangle': ['error', 'never'],
|
|
7
|
-
|
|
8
|
-
// Enforces a consistent indentation style.
|
|
9
|
-
'indent': ['error', 2],
|
|
10
|
-
|
|
11
|
-
// Enforces consistent line endings independent of operating system, VCS,
|
|
12
|
-
// or editor used across your codebase.
|
|
13
|
-
'linebreak-style': ['error', 'unix'],
|
|
14
|
-
|
|
15
|
-
// Enforces the consistent use of either backticks, double, or single
|
|
16
|
-
// quotes.
|
|
17
|
-
'quotes': ['error', 'single'],
|
|
18
|
-
|
|
19
|
-
// Enforces consistent use of semicolons.
|
|
20
|
-
'semi': ['error', 'always']
|
|
21
|
-
}
|
|
22
|
-
};
|
|
1
|
+
module.exports = require('./eslint.config.js');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jgarber/eslint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Shareable ESLint
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shareable ESLint configuration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
7
|
"eslintconfig",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "Jason Garber <jason@sixtwothree.org> (https://sixtwothree.org)",
|
|
15
15
|
"files": [
|
|
16
|
-
"
|
|
17
|
-
"module.js"
|
|
16
|
+
"eslint.config.js"
|
|
18
17
|
],
|
|
19
18
|
"main": "index.js",
|
|
20
19
|
"repository": "github:jgarber623/eslint-config",
|
|
@@ -24,8 +23,13 @@
|
|
|
24
23
|
"engines": {
|
|
25
24
|
"node": ">=16.0.0"
|
|
26
25
|
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"eslint": "^8.43.0",
|
|
28
|
+
"eslint-config-standard": "^17.1.0"
|
|
29
|
+
},
|
|
27
30
|
"peerDependencies": {
|
|
28
|
-
"eslint": "
|
|
31
|
+
"eslint": ">=8.43.0",
|
|
32
|
+
"eslint-config-standard": ">=17.1.0"
|
|
29
33
|
},
|
|
30
34
|
"publishConfig": {
|
|
31
35
|
"access": "public"
|
package/eleventy.js
DELETED