@guardian/eslint-config 7.0.1 → 8.0.1
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/.eslintrc.cjs +23 -0
- package/CHANGELOG.md +16 -0
- package/index.js +1 -1
- package/package.json +27 -14
- package/tsconfig.json +4 -0
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['../../../.eslintrc.cjs'],
|
|
3
|
+
ignorePatterns: [
|
|
4
|
+
'!**/*',
|
|
5
|
+
'node_modules',
|
|
6
|
+
'jest.dist.*', // depends on build output, so don't lint it
|
|
7
|
+
],
|
|
8
|
+
overrides: [
|
|
9
|
+
{
|
|
10
|
+
files: ['*.ts', '*.tsx'],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
tsconfigRootDir: __dirname,
|
|
13
|
+
},
|
|
14
|
+
rules: {},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
files: ['**/*.test.*'],
|
|
18
|
+
env: {
|
|
19
|
+
jest: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @guardian/eslint-config
|
|
2
2
|
|
|
3
|
+
## 8.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0382052: 1. All packages are now ES modules, although they should be compatible with CommonJS environments. 2. Adds entry points for projects that can consume [`package.json#exports`](https://nodejs.org/api/packages.html#exports), alongside `main`.
|
|
8
|
+
|
|
9
|
+
## 8.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- cc7aa7d: Requires curly braces in all circumstances.
|
|
14
|
+
|
|
15
|
+
This should help reduce noise in diffs, and remove ambiguity about when you should use curly braces (and possibly when a block starts and ends), especially for people unfamiliar with the language.
|
|
16
|
+
|
|
17
|
+
_Note that this rule is fixable, so running eslint with the `--fix` flag will automatically update your code to comply with the new setting._
|
|
18
|
+
|
|
3
19
|
## 7.0.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@ module.exports = {
|
|
|
13
13
|
plugins: ['eslint-comments'],
|
|
14
14
|
rules: {
|
|
15
15
|
// prevent dangling returns without braces
|
|
16
|
-
curly: ['error', '
|
|
16
|
+
curly: ['error', 'all'],
|
|
17
17
|
|
|
18
18
|
// require a `eslint-enable` comment for every `eslint-disable` comment
|
|
19
19
|
'eslint-comments/disable-enable-pair': [2, { allowWholeFile: true }],
|
package/package.json
CHANGED
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "ESLint config for Guardian JavaScript projects",
|
|
5
|
-
"homepage": "https://github.com/guardian/csnx/tree/main/libs/@guardian/eslint-config#readme",
|
|
6
|
-
"bugs": {
|
|
7
|
-
"url": "https://github.com/guardian/csnx/issues"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/guardian/csnx.git"
|
|
12
|
-
},
|
|
13
|
-
"license": "MIT",
|
|
14
5
|
"main": "index.js",
|
|
15
6
|
"dependencies": {
|
|
16
7
|
"eslint-config-prettier": "9.1.0",
|
|
17
8
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
18
9
|
"eslint-plugin-import": "2.29.1"
|
|
19
10
|
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"eslint": "8.56.0",
|
|
13
|
+
"tslib": "^2.6.2"
|
|
14
|
+
},
|
|
20
15
|
"peerDependencies": {
|
|
21
16
|
"eslint": "^8.56.0",
|
|
22
17
|
"tslib": "^2.6.2"
|
|
23
18
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
19
|
+
"nx": {
|
|
20
|
+
"targets": {
|
|
21
|
+
"lint": {
|
|
22
|
+
"inputs": [
|
|
23
|
+
"{projectRoot}/**",
|
|
24
|
+
"{workspaceRoot}/.eslint*"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"fix": {
|
|
28
|
+
"inputs": [
|
|
29
|
+
"{projectRoot}/**",
|
|
30
|
+
"{workspaceRoot}/.eslint*"
|
|
31
|
+
],
|
|
32
|
+
"outputs": [
|
|
33
|
+
"{projectRoot}"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
26
37
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
38
|
+
"scripts": {
|
|
39
|
+
"fix": "pnpm lint --fix",
|
|
40
|
+
"lint": "eslint --cache ."
|
|
41
|
+
}
|
|
29
42
|
}
|
package/tsconfig.json
ADDED