eslint-config-simplesense 4.0.1 → 4.0.2
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/config/node.js +13 -0
- package/package.json +1 -1
- package/rules/node.js +5 -33
package/config/node.js
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const ROOT_DIR = path.resolve(__dirname, '../../../'); // this will be in <PROJECT>/node_modules/eslint-config-simplesense/rules/
|
|
7
|
+
const NODE_VERSION = '>=16.0.0';
|
|
8
|
+
|
|
4
9
|
module.exports = {
|
|
5
10
|
name: 'simplesense/node',
|
|
6
11
|
plugins: {
|
|
7
12
|
n: require('eslint-plugin-n'),
|
|
8
13
|
},
|
|
9
14
|
rules: require('../rules/node'),
|
|
15
|
+
settings: {
|
|
16
|
+
allowModules: ['aws-sdk'],
|
|
17
|
+
convertPath: {
|
|
18
|
+
[`${ path.relative(ROOT_DIR, '/opt/nodejs') }/*`]: [ '^(.*?)/opt/nodejs/(.*?)$', 'lambda/layers/$2/nodejs/$2' ],
|
|
19
|
+
},
|
|
20
|
+
resolvePaths: [path.resolve(__dirname, `${ ROOT_DIR }/lambda/layers/node-modules/nodejs/node_modules`)],
|
|
21
|
+
version: NODE_VERSION,
|
|
22
|
+
},
|
|
10
23
|
};
|
|
11
24
|
})();
|
package/package.json
CHANGED
package/rules/node.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
'use strict';
|
|
3
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
4
|
module.exports = {
|
|
10
5
|
'n/callback-return': [
|
|
11
6
|
'error', [
|
|
@@ -18,18 +13,9 @@
|
|
|
18
13
|
// not used because it does not support IIFE
|
|
19
14
|
// 'n/global-require': ['error'],
|
|
20
15
|
'n/handle-callback-err': ['error'],
|
|
21
|
-
'n/no-deprecated-api': [
|
|
22
|
-
'error', {
|
|
23
|
-
version: NODE_VERSION,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
16
|
+
'n/no-deprecated-api': ['error'],
|
|
26
17
|
'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
|
-
],
|
|
18
|
+
'n/no-missing-require': ['error'],
|
|
33
19
|
'n/no-mixed-requires': [
|
|
34
20
|
'error', {
|
|
35
21
|
allowCall: true,
|
|
@@ -38,26 +24,12 @@
|
|
|
38
24
|
],
|
|
39
25
|
'n/no-new-require': ['error'],
|
|
40
26
|
'n/no-path-concat': ['error'],
|
|
41
|
-
'n/no-unsupported-features/es-builtins': [
|
|
42
|
-
'error', {
|
|
43
|
-
version: NODE_VERSION,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
27
|
+
'n/no-unsupported-features/es-builtins': ['error'],
|
|
46
28
|
'n/no-unsupported-features/es-syntax': ['off'],
|
|
47
|
-
'n/no-unsupported-features/node-builtins': [
|
|
48
|
-
'error', {
|
|
49
|
-
version: NODE_VERSION,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
29
|
+
'n/no-unsupported-features/node-builtins': ['error'],
|
|
52
30
|
'n/no-unpublished-bin': ['error'],
|
|
53
31
|
'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
|
-
],
|
|
32
|
+
'n/no-unpublished-require': ['error'],
|
|
61
33
|
'n/prefer-global/buffer': [ 'error', 'always' ],
|
|
62
34
|
'n/prefer-global/console': [ 'error', 'always' ],
|
|
63
35
|
'n/prefer-global/process': [ 'error', 'always' ],
|