@enormora/eslint-config-aws-cdk 0.0.3 → 0.0.5
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/package.json +2 -2
- package/presets/aws-cdk/aws-cdk.js +1 -1
- package/readme.md +16 -16
- package/sbom.cdx.json +10 -10
package/package.json
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"name": "@enormora/eslint-config-aws-cdk",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@enormora/eslint-config-base": "0.0.
|
|
15
|
+
"@enormora/eslint-config-base": "0.0.36"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git://github.com/enormora/eslint-config.git"
|
|
20
20
|
},
|
|
21
21
|
"type": "module",
|
|
22
|
-
"version": "0.0.
|
|
22
|
+
"version": "0.0.5"
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createNoClassDeclarationRestriction } from '@enormora/eslint-config-base/rule-sets/restricted-syntax.js';
|
|
2
2
|
|
|
3
3
|
const cdkClassDeclarationRestriction = createNoClassDeclarationRestriction({
|
|
4
|
-
allowedSuperClassNamePattern: '/(Error|Construct|Stack|Resource)$/',
|
|
4
|
+
allowedSuperClassNamePattern: '/(Error|Construct|Stack|Stage|App|Resource)$/',
|
|
5
5
|
message: 'Class declarations are not allowed except for extending errors or CDK constructs.'
|
|
6
6
|
});
|
|
7
7
|
|
package/readme.md
CHANGED
|
@@ -6,7 +6,7 @@ Config preset for AWS CDK projects. Disables a small set of rules that conflict
|
|
|
6
6
|
|
|
7
7
|
## What it disables and why
|
|
8
8
|
|
|
9
|
-
- `no-restricted-syntax` — re-applies the switch and TS enum bans, and keeps the class-declaration ban but widens its allowlist so classes whose superclass name ends in `Error`, `Construct`, `Stack`, or `Resource` (e.g. `MyStack extends Stack`, custom errors) are permitted.
|
|
9
|
+
- `no-restricted-syntax` — re-applies the switch and TS enum bans, and keeps the class-declaration ban but widens its allowlist so classes whose superclass name ends in `Error`, `Construct`, `Stack`, `Stage`, `App`, or `Resource` (e.g. `MyStack extends Stack`, custom errors) are permitted.
|
|
10
10
|
- `no-new` — `new MyStack(app, 'id', props)` is the canonical way to register stacks and constructs; the side-effecting `new` is intentional.
|
|
11
11
|
- `sonarjs/constructor-for-side-effects` — child constructs register themselves on their parent via `super(scope, id)` in the constructor; the returned instance is often unused.
|
|
12
12
|
- `functional/no-this-expressions` — construct constructors reference `this` to expose typed children to consumers.
|
|
@@ -22,22 +22,22 @@ npm install --save-dev @enormora/eslint-config-base @enormora/eslint-config-type
|
|
|
22
22
|
Apply the preset to the directories that hold CDK code (typically a folder named `infrastructure/` or similar) in your `eslint.config.js`:
|
|
23
23
|
|
|
24
24
|
```javascript
|
|
25
|
-
import { awsCdkConfig } from
|
|
26
|
-
import { baseConfig } from
|
|
27
|
-
import { typescriptConfig } from
|
|
25
|
+
import { awsCdkConfig } from '@enormora/eslint-config-aws-cdk';
|
|
26
|
+
import { baseConfig } from '@enormora/eslint-config-base';
|
|
27
|
+
import { typescriptConfig } from '@enormora/eslint-config-typescript';
|
|
28
28
|
|
|
29
29
|
export default [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
{
|
|
31
|
+
ignores: [ 'cdk.out/**/*' ]
|
|
32
|
+
},
|
|
33
|
+
...baseConfig,
|
|
34
|
+
{
|
|
35
|
+
...typescriptConfig,
|
|
36
|
+
files: [ '**/*.ts' ]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
...awsCdkConfig,
|
|
40
|
+
files: [ '**/infrastructure/**/*.ts' ]
|
|
41
|
+
}
|
|
42
42
|
];
|
|
43
43
|
```
|
package/sbom.cdx.json
CHANGED
|
@@ -9,42 +9,42 @@
|
|
|
9
9
|
{
|
|
10
10
|
"type": "application",
|
|
11
11
|
"name": "packtory",
|
|
12
|
-
"version": "0.0.
|
|
12
|
+
"version": "0.0.32"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "@enormora/eslint-config-aws-cdk",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/@enormora/eslint-config-aws-cdk@0.0.
|
|
21
|
-
"purl": "pkg:npm/@enormora/eslint-config-aws-cdk@0.0.
|
|
19
|
+
"version": "0.0.5",
|
|
20
|
+
"bom-ref": "pkg:npm/@enormora/eslint-config-aws-cdk@0.0.5",
|
|
21
|
+
"purl": "pkg:npm/@enormora/eslint-config-aws-cdk@0.0.5"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
25
25
|
{
|
|
26
26
|
"type": "library",
|
|
27
27
|
"name": "@enormora/eslint-config-base",
|
|
28
|
-
"version": "0.0.
|
|
29
|
-
"bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
28
|
+
"version": "0.0.36",
|
|
29
|
+
"bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.36",
|
|
30
30
|
"scope": "optional",
|
|
31
31
|
"licenses": [
|
|
32
32
|
{
|
|
33
33
|
"expression": "MIT"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
-
"purl": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
36
|
+
"purl": "pkg:npm/@enormora/eslint-config-base@0.0.36"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"dependencies": [
|
|
40
40
|
{
|
|
41
|
-
"ref": "pkg:npm/@enormora/eslint-config-aws-cdk@0.0.
|
|
41
|
+
"ref": "pkg:npm/@enormora/eslint-config-aws-cdk@0.0.5",
|
|
42
42
|
"dependsOn": [
|
|
43
|
-
"pkg:npm/@enormora/eslint-config-base@0.0.
|
|
43
|
+
"pkg:npm/@enormora/eslint-config-base@0.0.36"
|
|
44
44
|
]
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
"ref": "pkg:npm/@enormora/eslint-config-base@0.0.
|
|
47
|
+
"ref": "pkg:npm/@enormora/eslint-config-base@0.0.36"
|
|
48
48
|
}
|
|
49
49
|
]
|
|
50
50
|
}
|