eslint-config-simplesense 3.2.0 → 4.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/README.md +3 -3
- package/config/array-func.js +11 -0
- package/config/eslint-comments.js +13 -0
- package/config/eslint.js +15 -0
- package/config/import.js +11 -0
- package/config/no-use-extend-native.js +13 -0
- package/config/node.js +11 -0
- package/config/optimize-regex.js +13 -0
- package/config/regexp.js +13 -0
- package/config/security.js +11 -0
- package/config/sonarjs.js +16 -0
- package/config/unicorn.js +11 -0
- package/config/vue.js +17 -0
- package/config/yaml.js +17 -0
- package/index.js +47 -102
- package/package.json +30 -25
- package/rules/node.js +71 -0
- package/rules/vue.js +14 -0
- package/rules/yaml.js +27 -0
- package/plugins/node.js +0 -71
- /package/{plugins → rules}/array-func.js +0 -0
- /package/{plugins → rules}/eslint-recommended.js +0 -0
- /package/{plugins → rules}/import.js +0 -0
- /package/{plugins → rules}/security.js +0 -0
- /package/{plugins → rules}/sonarjs.js +0 -0
- /package/{plugins → rules}/unicorn.js +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Simplesense ESLint Config
|
|
2
2
|
|
|
3
3
|
[](https://simplesenseio.github.io/eslint-config-simplesense/)
|
|
4
4
|
[](https://github.com/simplesenseio/eslint-config-simplesense/actions/workflows/build.yaml)
|
|
@@ -21,8 +21,8 @@ Adding plugins is fairly straightforward.
|
|
|
21
21
|
|
|
22
22
|
**Step 1**
|
|
23
23
|
|
|
24
|
-
- To simply use a recommended configuration, add the plugin as a dependency and add the
|
|
25
|
-
- To configure custom rules for a plugin, add a new file, [`
|
|
24
|
+
- To simply use a recommended configuration, add the plugin as a dependency and add config to the [config](./config/) directory that imports the recommended rules and the plugin itself. Then add the config to the exported array in [`index.js`](./index.js).
|
|
25
|
+
- To configure custom rules for a plugin, add a new file, [`rules/<plugin-name>.js`](./rules/), and export the rules object. Then add the config by following the details in the previous step, however, use the custom rules by themselves or with the exported recommended rules of the plugin.
|
|
26
26
|
- If the new plugin lints a new file type, add a `index.<filetype>` file to the [`filetypes`](./filetypes/) directory and update the `lint:eslint` script in [`package.json`](./package.json) to include the new extension.
|
|
27
27
|
|
|
28
28
|
**Step 2**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const plugin = require('@eslint-community/eslint-plugin-eslint-comments');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
name: 'simplesense/eslint-comments',
|
|
8
|
+
plugins: {
|
|
9
|
+
'@eslint-community/eslint-comments': plugin,
|
|
10
|
+
},
|
|
11
|
+
rules: plugin.configs.recommended.rules,
|
|
12
|
+
};
|
|
13
|
+
})();
|
package/config/eslint.js
ADDED
package/config/import.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const plugin = require('eslint-plugin-no-use-extend-native');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
name: 'simplesense/no-use-extend-native',
|
|
8
|
+
plugins: {
|
|
9
|
+
'no-use-extend-native': plugin,
|
|
10
|
+
},
|
|
11
|
+
rules: plugin.configs.recommended.rules,
|
|
12
|
+
};
|
|
13
|
+
})();
|
package/config/node.js
ADDED
package/config/regexp.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const plugin = require('eslint-plugin-sonarjs');
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
name: 'simplesense/sonarjs',
|
|
8
|
+
plugins: {
|
|
9
|
+
sonarjs: plugin,
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
...plugin.configs.recommended.rules,
|
|
13
|
+
...require('../rules/sonarjs'),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
})();
|
package/config/vue.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const plugin = require('eslint-plugin-vue');
|
|
5
|
+
|
|
6
|
+
module.exports = [
|
|
7
|
+
...plugin.configs['flat/vue2-strongly-recommended'],
|
|
8
|
+
{
|
|
9
|
+
name: 'simplesense/vue',
|
|
10
|
+
files: [ '*.vue', '**/*.vue' ],
|
|
11
|
+
plugins: {
|
|
12
|
+
vue: plugin,
|
|
13
|
+
},
|
|
14
|
+
rules: require('../rules/vue'),
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
})();
|
package/config/yaml.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const plugin = require('eslint-plugin-yml');
|
|
5
|
+
|
|
6
|
+
module.exports = [
|
|
7
|
+
...plugin.configs['flat/standard'],
|
|
8
|
+
{
|
|
9
|
+
name: 'simplesense/yaml',
|
|
10
|
+
files: [ '*.yaml', '**/*.yaml', '*.yml', '**/*.yml' ],
|
|
11
|
+
plugins: {
|
|
12
|
+
yaml: plugin,
|
|
13
|
+
},
|
|
14
|
+
rules: require('../rules/yaml'),
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
})();
|
package/index.js
CHANGED
|
@@ -1,111 +1,56 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
'eslint:recommended': require('./plugins/eslint-recommended'),
|
|
6
|
-
};
|
|
4
|
+
const globals = require('globals');
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
unicorn: require('./plugins/unicorn'),
|
|
15
|
-
};
|
|
6
|
+
// remove this and the core-js dependency
|
|
7
|
+
// when we drop support for node 16
|
|
8
|
+
if (!('structuredClone' in globalThis)) {
|
|
9
|
+
// eslint-disable-next-line import/no-unassigned-import
|
|
10
|
+
require('core-js/actual');
|
|
11
|
+
}
|
|
16
12
|
|
|
17
|
-
module.exports =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ecmaVersion: 2022,
|
|
42
|
-
},
|
|
43
|
-
ignorePatterns: [
|
|
44
|
-
'!.*',
|
|
45
|
-
'.cache/',
|
|
46
|
-
'.git/',
|
|
47
|
-
'.github/actions/',
|
|
48
|
-
'.npm/',
|
|
49
|
-
'.nyc_output/',
|
|
50
|
-
'coverage/',
|
|
51
|
-
'lib-cov/',
|
|
52
|
-
'node_modules/',
|
|
53
|
-
'**/*.min.*',
|
|
54
|
-
],
|
|
55
|
-
rules: [
|
|
56
|
-
...Object.values(EXTENDS),
|
|
57
|
-
...Object.values(PLUGINS),
|
|
58
|
-
].reduce((object, value) => Object.assign(object, value), {}),
|
|
59
|
-
overrides: [
|
|
60
|
-
{
|
|
61
|
-
files: ['*.vue'],
|
|
62
|
-
extends: [
|
|
63
|
-
'plugin:vue/recommended',
|
|
64
|
-
'plugin:vue/strongly-recommended',
|
|
65
|
-
'plugin:vue/essential',
|
|
66
|
-
],
|
|
67
|
-
plugins: ['vue'],
|
|
68
|
-
rules: {
|
|
69
|
-
'unicorn/filename-case': [
|
|
70
|
-
'error', {
|
|
71
|
-
case: 'pascalCase',
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
'vue/component-name-in-template-casing': [ 'error', 'kebab-case' ],
|
|
75
|
-
'vue/component-definition-name-casing': [ 'error', 'kebab-case' ],
|
|
76
|
-
'vue/singleline-html-element-content-newline': 'off',
|
|
77
|
-
},
|
|
78
|
-
}, {
|
|
79
|
-
files: [ '*.yml', '*.yaml' ],
|
|
80
|
-
extends: ['plugin:yml/standard'],
|
|
81
|
-
plugins: ['yml'],
|
|
82
|
-
rules: {
|
|
83
|
-
'yml/block-sequence': [ 'error', 'always' ],
|
|
84
|
-
'yml/file-extension': [
|
|
85
|
-
'error',
|
|
86
|
-
{
|
|
87
|
-
extension: 'yaml',
|
|
88
|
-
caseSensitive: true,
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
'yml/indent': [
|
|
92
|
-
'error',
|
|
93
|
-
2,
|
|
94
|
-
{
|
|
95
|
-
indentBlockSequences: true,
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
'yml/no-empty-document': ['off'],
|
|
99
|
-
'yml/quotes': [
|
|
100
|
-
'error', {
|
|
101
|
-
prefer: 'single',
|
|
102
|
-
},
|
|
103
|
-
],
|
|
13
|
+
module.exports = [
|
|
14
|
+
require('./config/eslint'),
|
|
15
|
+
require('./config/array-func'),
|
|
16
|
+
require('./config/eslint-comments'),
|
|
17
|
+
require('./config/import'),
|
|
18
|
+
require('./config/no-use-extend-native'),
|
|
19
|
+
require('./config/node'),
|
|
20
|
+
require('./config/optimize-regex'),
|
|
21
|
+
require('./config/regexp'),
|
|
22
|
+
require('./config/security'),
|
|
23
|
+
require('./config/sonarjs'),
|
|
24
|
+
require('./config/unicorn'),
|
|
25
|
+
...require('./config/vue'), // exports an array
|
|
26
|
+
...require('./config/yaml'), // exports an array
|
|
27
|
+
{
|
|
28
|
+
languageOptions: {
|
|
29
|
+
sourceType: 'commonjs',
|
|
30
|
+
globals: {
|
|
31
|
+
...globals.browser,
|
|
32
|
+
...globals.es2021,
|
|
33
|
+
...globals.es6,
|
|
34
|
+
...globals.jest,
|
|
35
|
+
...globals.node,
|
|
36
|
+
spyFn: true,
|
|
104
37
|
},
|
|
105
38
|
},
|
|
106
|
-
],
|
|
107
|
-
globals: {
|
|
108
|
-
spyFn: true,
|
|
109
39
|
},
|
|
110
|
-
|
|
40
|
+
{
|
|
41
|
+
// it's a bit confusing, but this needs to be in a config all by itself
|
|
42
|
+
// https://github.com/eslint/eslint/issues/17400
|
|
43
|
+
ignores: [
|
|
44
|
+
'!.*',
|
|
45
|
+
'.cache/',
|
|
46
|
+
'.git/',
|
|
47
|
+
'.github/actions/',
|
|
48
|
+
'.npm/',
|
|
49
|
+
'coverage/',
|
|
50
|
+
'lib-cov/',
|
|
51
|
+
'node_modules/',
|
|
52
|
+
'**/*.min.*',
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
];
|
|
111
56
|
})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-simplesense",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "ESLint Config for
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "ESLint Config for Simplesense Styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
7
|
"config",
|
|
@@ -20,26 +20,31 @@
|
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"files": [
|
|
22
22
|
"index.js",
|
|
23
|
-
"
|
|
23
|
+
"config/**/*",
|
|
24
|
+
"rules/**/*"
|
|
24
25
|
],
|
|
25
26
|
"scripts": {
|
|
26
|
-
"
|
|
27
|
-
"docs
|
|
28
|
-
"docs:
|
|
29
|
-
"docs:
|
|
27
|
+
"configs:build": "node scripts/generate-configs.js",
|
|
28
|
+
"docs": "npm run docs:clean && npm run docs:generate && npm run vitepress:sidebar && npm run docs:build && npm run docs:mv && npm run docs:nojekyll",
|
|
29
|
+
"docs:build": "vitepress build docs",
|
|
30
|
+
"docs:clean": "rm -rf docs/.vitepress/dist ./dist",
|
|
31
|
+
"docs:dev": "npm run docs:clean && npm run docs:generate && npm run vitepress:sidebar && vitepress dev docs",
|
|
30
32
|
"docs:generate": "node scripts/generate-docs.js",
|
|
31
|
-
"docs:mv": "mv docs/.
|
|
33
|
+
"docs:mv": "mv docs/.vitepress/dist ./",
|
|
32
34
|
"docs:nojekyll": "touch dist/.nojekyll",
|
|
33
35
|
"lint": "npm run lint:package-json && npm run lint:eslint",
|
|
34
|
-
"lint:eslint": "eslint --
|
|
36
|
+
"lint:eslint": "eslint --fix '**/*.{mjs,js,vue,yaml,yml}'",
|
|
35
37
|
"lint:package-json": "sort-package-json",
|
|
36
|
-
"
|
|
38
|
+
"pretest": "npm run configs:build",
|
|
39
|
+
"test": "NODE_OPTIONS=\"${NODE_OPTIONS} --experimental-vm-modules\" jest",
|
|
40
|
+
"vitepress:sidebar": "node scripts/generate-vitepress-sidebar.js"
|
|
37
41
|
},
|
|
38
42
|
"jest": {
|
|
39
43
|
"collectCoverage": true,
|
|
40
44
|
"collectCoverageFrom": [
|
|
41
45
|
"index.js",
|
|
42
|
-
"
|
|
46
|
+
"config/*.js",
|
|
47
|
+
"rules/*.js"
|
|
43
48
|
],
|
|
44
49
|
"moduleNameMapper": {
|
|
45
50
|
"eslint/use-at-your-own-risk": "eslint/lib/unsupported-api"
|
|
@@ -58,29 +63,29 @@
|
|
|
58
63
|
"verbose": true
|
|
59
64
|
},
|
|
60
65
|
"dependencies": {
|
|
66
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
67
|
+
"@eslint/js": "^9.5.0",
|
|
68
|
+
"core-js": "^3.37.1",
|
|
61
69
|
"eslint-plugin-array-func": "^4.0.0",
|
|
62
|
-
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
63
70
|
"eslint-plugin-import": "^2.29.1",
|
|
71
|
+
"eslint-plugin-n": "^17.4.0",
|
|
64
72
|
"eslint-plugin-no-use-extend-native": "^0.5.0",
|
|
65
|
-
"eslint-plugin-node": "^11.1.0",
|
|
66
73
|
"eslint-plugin-optimize-regex": "^1.2.1",
|
|
67
|
-
"eslint-plugin-regexp": "^2.
|
|
68
|
-
"eslint-plugin-security": "^
|
|
69
|
-
"eslint-plugin-sonarjs": "^0.
|
|
70
|
-
"eslint-plugin-unicorn": "^
|
|
71
|
-
"eslint-plugin-vue": "^9.
|
|
72
|
-
"eslint-plugin-yml": "^1.
|
|
74
|
+
"eslint-plugin-regexp": "^2.6.0",
|
|
75
|
+
"eslint-plugin-security": "^3.0.1",
|
|
76
|
+
"eslint-plugin-sonarjs": "^1.0.3",
|
|
77
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
78
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
79
|
+
"eslint-plugin-yml": "^1.14.0",
|
|
80
|
+
"globals": "^15.6.0"
|
|
73
81
|
},
|
|
74
82
|
"devDependencies": {
|
|
75
|
-
"@vuepress/plugin-pwa": "^1.9.10",
|
|
76
83
|
"eslint": "^8.57.0",
|
|
77
|
-
"hash-sum": "^2.0.0",
|
|
78
84
|
"jest": "^29.7.0",
|
|
79
|
-
"sort-package-json": "^2.
|
|
80
|
-
"
|
|
81
|
-
"vuepress-theme-default-prefers-color-scheme": "^2.0.0"
|
|
85
|
+
"sort-package-json": "^2.10.0",
|
|
86
|
+
"vitepress": "^1.2.3"
|
|
82
87
|
},
|
|
83
88
|
"peerDependencies": {
|
|
84
|
-
"eslint": "
|
|
89
|
+
"eslint": "8.x"
|
|
85
90
|
}
|
|
86
91
|
}
|
package/rules/node.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const NODE_VERSION = '>=16.0.0';
|
|
7
|
+
const ROOT_DIR = path.resolve(__dirname, '../../../'); // this will be in <PROJECT>/node_modules/eslint-config-simplesense/rules/
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
'n/callback-return': [
|
|
11
|
+
'error', [
|
|
12
|
+
'callback',
|
|
13
|
+
'cb',
|
|
14
|
+
'done',
|
|
15
|
+
'next',
|
|
16
|
+
],
|
|
17
|
+
],
|
|
18
|
+
// not used because it does not support IIFE
|
|
19
|
+
// 'n/global-require': ['error'],
|
|
20
|
+
'n/handle-callback-err': ['error'],
|
|
21
|
+
'n/no-deprecated-api': [
|
|
22
|
+
'error', {
|
|
23
|
+
version: NODE_VERSION,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'n/no-missing-import': ['error'],
|
|
27
|
+
'n/no-missing-require': [
|
|
28
|
+
'error', {
|
|
29
|
+
allowModules: ['aws-sdk'],
|
|
30
|
+
resolvePaths: [path.resolve(__dirname, `${ ROOT_DIR }/lambda/layers/node-modules/nodejs/node_modules`)],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
'n/no-mixed-requires': [
|
|
34
|
+
'error', {
|
|
35
|
+
allowCall: true,
|
|
36
|
+
grouping: true,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
'n/no-new-require': ['error'],
|
|
40
|
+
'n/no-path-concat': ['error'],
|
|
41
|
+
'n/no-unsupported-features/es-builtins': [
|
|
42
|
+
'error', {
|
|
43
|
+
version: NODE_VERSION,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
'n/no-unsupported-features/es-syntax': ['off'],
|
|
47
|
+
'n/no-unsupported-features/node-builtins': [
|
|
48
|
+
'error', {
|
|
49
|
+
version: NODE_VERSION,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'n/no-unpublished-bin': ['error'],
|
|
53
|
+
'n/no-unpublished-import': ['error'],
|
|
54
|
+
'n/no-unpublished-require': [
|
|
55
|
+
'error', {
|
|
56
|
+
convertPath: {
|
|
57
|
+
[`${ path.relative(ROOT_DIR, '/opt/nodejs') }/*`]: [ '^(.*?)/opt/nodejs/(.*?)$', 'lambda/layers/$2/nodejs/$2' ],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
'n/prefer-global/buffer': [ 'error', 'always' ],
|
|
62
|
+
'n/prefer-global/console': [ 'error', 'always' ],
|
|
63
|
+
'n/prefer-global/process': [ 'error', 'always' ],
|
|
64
|
+
'n/prefer-global/text-decoder': [ 'error', 'never' ],
|
|
65
|
+
'n/prefer-global/text-encoder': [ 'error', 'never' ],
|
|
66
|
+
'n/prefer-global/url-search-params': [ 'error', 'never' ],
|
|
67
|
+
'n/prefer-global/url': [ 'error', 'never' ],
|
|
68
|
+
'n/prefer-promises/dns': ['error'],
|
|
69
|
+
'n/prefer-promises/fs': ['error'],
|
|
70
|
+
};
|
|
71
|
+
})();
|
package/rules/vue.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
'unicorn/filename-case': [
|
|
6
|
+
'error', {
|
|
7
|
+
case: 'pascalCase',
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
'vue/component-name-in-template-casing': [ 'error', 'kebab-case' ],
|
|
11
|
+
'vue/component-definition-name-casing': [ 'error', 'kebab-case' ],
|
|
12
|
+
'vue/singleline-html-element-content-newline': 'off',
|
|
13
|
+
};
|
|
14
|
+
})();
|
package/rules/yaml.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
'yml/block-sequence': [ 'error', 'always' ],
|
|
6
|
+
'yml/file-extension': [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
extension: 'yaml',
|
|
10
|
+
caseSensitive: true,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
'yml/indent': [
|
|
14
|
+
'error',
|
|
15
|
+
2,
|
|
16
|
+
{
|
|
17
|
+
indentBlockSequences: true,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
'yml/no-empty-document': ['off'],
|
|
21
|
+
'yml/quotes': [
|
|
22
|
+
'error', {
|
|
23
|
+
prefer: 'single',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
})();
|
package/plugins/node.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
(() => {
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const NODE_VERSION = '>=14.0.0';
|
|
7
|
-
const ROOT_DIR = path.resolve(__dirname, '../../../');
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
'node/callback-return': [
|
|
11
|
-
'error', [
|
|
12
|
-
'callback',
|
|
13
|
-
'cb',
|
|
14
|
-
'done',
|
|
15
|
-
'next',
|
|
16
|
-
],
|
|
17
|
-
],
|
|
18
|
-
// not used because it does not support IIFE
|
|
19
|
-
// 'node/global-require': ['error'],
|
|
20
|
-
'node/handle-callback-err': ['error'],
|
|
21
|
-
'node/no-deprecated-api': [
|
|
22
|
-
'error', {
|
|
23
|
-
version: NODE_VERSION,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
'node/no-missing-import': ['error'],
|
|
27
|
-
'node/no-missing-require': [
|
|
28
|
-
'error', {
|
|
29
|
-
allowModules: ['aws-sdk'],
|
|
30
|
-
resolvePaths: [path.resolve(__dirname, `${ ROOT_DIR }/lambda/layers/node-modules/nodejs/node_modules`)],
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
'node/no-mixed-requires': [
|
|
34
|
-
'error', {
|
|
35
|
-
allowCall: true,
|
|
36
|
-
grouping: true,
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
'node/no-new-require': ['error'],
|
|
40
|
-
'node/no-path-concat': ['error'],
|
|
41
|
-
'node/no-unsupported-features/es-builtins': [
|
|
42
|
-
'error', {
|
|
43
|
-
version: NODE_VERSION,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
'node/no-unsupported-features/es-syntax': ['off'],
|
|
47
|
-
'node/no-unsupported-features/node-builtins': [
|
|
48
|
-
'error', {
|
|
49
|
-
version: NODE_VERSION,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
'node/no-unpublished-bin': ['error'],
|
|
53
|
-
'node/no-unpublished-import': ['error'],
|
|
54
|
-
'node/no-unpublished-require': [
|
|
55
|
-
'error', {
|
|
56
|
-
convertPath: {
|
|
57
|
-
[`${ path.relative(ROOT_DIR, '/opt/nodejs') }/*`]: [ '^(.*?)/opt/nodejs/(.*?)$', 'lambda/layers/$2/nodejs/$2' ],
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
'node/prefer-global/buffer': [ 'error', 'always' ],
|
|
62
|
-
'node/prefer-global/console': [ 'error', 'always' ],
|
|
63
|
-
'node/prefer-global/process': [ 'error', 'always' ],
|
|
64
|
-
'node/prefer-global/text-decoder': [ 'error', 'never' ],
|
|
65
|
-
'node/prefer-global/text-encoder': [ 'error', 'never' ],
|
|
66
|
-
'node/prefer-global/url-search-params': [ 'error', 'never' ],
|
|
67
|
-
'node/prefer-global/url': [ 'error', 'never' ],
|
|
68
|
-
'node/prefer-promises/dns': ['error'],
|
|
69
|
-
'node/prefer-promises/fs': ['error'],
|
|
70
|
-
};
|
|
71
|
-
})();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|