@@ -21,58 +21,70 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
21
21
22
22
/**
23
23
* @type {import('eslint').Linter.Config }
24
- * @see { @link https://eslint.org/}
24
+ * @see https://eslint.org/
25
25
*/
26
26
module . exports = {
27
27
root : true ,
28
28
plugins : [
29
29
/* see https://github.com/lydell/eslint-plugin-simple-import-sort#readme */
30
30
'simple-import-sort' ,
31
31
/* see https://github.com/Stuk/eslint-plugin-header#readme */
32
- 'header'
32
+ 'header' ,
33
+ /* see https://github.com/phanect/eslint-plugin-editorconfig */
34
+ 'editorconfig'
33
35
] ,
34
36
env : {
35
37
commonjs : true ,
36
38
browser : true ,
37
39
node : true
38
40
} ,
41
+ extends : [
42
+ /* see https://github.com/phanect/eslint-plugin-editorconfig */
43
+ 'plugin:editorconfig/all'
44
+ ] ,
39
45
rules : {
40
46
// region sort imports/exports
41
47
/* disable other sorters in favour of `simple-import-sort` */
42
- 'import/order' : 0 ,
43
- 'sort-imports' : 0 ,
48
+ 'import/order' : 'off' ,
49
+ 'sort-imports' : 'off' ,
44
50
/* see https://github.com/lydell/eslint-plugin-simple-import-sort/ */
45
51
'simple-import-sort/imports' : 'error' ,
46
52
'simple-import-sort/exports' : 'error' ,
47
53
// endregion sort imports/exports
48
54
// region license-header
49
55
/* see https://github.com/Stuk/eslint-plugin-header#readme */
50
- 'header/header' : [ 'error' , './.license-header.js' ]
56
+ 'header/header' : [ 'error' , './.license-header.js' ] ,
51
57
// endregion license-header
58
+ // indent is managed by plugin '*standard'
59
+ 'editorconfig/indent' : 'off'
52
60
} ,
53
61
overrides : [
62
+ {
63
+ files : [ '*.node.*' ] ,
64
+ env : { browser : false , node : true }
65
+ } ,
66
+ {
67
+ files : [ '*.web.*' ] ,
68
+ env : { browser : true , node : false }
69
+ } ,
54
70
{
55
71
files : [ '*.spec.*' , '*.test.*' ] ,
56
72
env : {
57
73
mocha : true ,
58
- commonjs : true ,
59
74
node : true ,
60
75
browser : false // change, when mocha is enabled for browser
61
76
}
62
77
} ,
63
78
{
64
79
files : [ '*.ts' ] ,
65
- extends : [
66
- /* see https://github.com/standard/ts-standard */
67
- 'standard-with-typescript'
68
- ] ,
69
80
plugins : [
70
81
/* see https://github.com/microsoft/tsdoc */
71
82
'eslint-plugin-tsdoc'
72
83
] ,
73
- parserOptions : {
74
- project : './tsconfig.json'
75
- } ,
84
+ extends : [
85
+ /* see https://github.com/standard/ts-standard */
86
+ 'standard-with-typescript'
87
+ ] ,
76
88
rules : {
77
89
// region override rules from plugin 'standard-with-typescript'
78
90
/* @see https://typescript-eslint.io/rules/consistent-type-imports/ */
@@ -91,20 +103,23 @@ module.exports = {
91
103
/* see https://github.com/microsoft/tsdoc */
92
104
'tsdoc/syntax' : 'error'
93
105
// endregion docs
106
+ } ,
107
+ parserOptions : {
108
+ project : './tsconfig.json'
94
109
}
95
110
} ,
96
111
{
97
112
files : [ '*.js' , '*.mjs' , '*.cjs' ] ,
113
+ plugins : [
114
+ /* see https://github.com/gajus/eslint-plugin-jsdoc/ */
115
+ 'jsdoc'
116
+ ] ,
98
117
extends : [
99
118
/* see https://www.npmjs.com/package/eslint-config-standard */
100
119
'standard' ,
101
120
/* see https://github.com/gajus/eslint-plugin-jsdoc */
102
121
'plugin:jsdoc/recommended'
103
122
] ,
104
- plugins : [
105
- /* see https://github.com/gajus/eslint-plugin-jsdoc/ */
106
- 'jsdoc'
107
- ] ,
108
123
rules : {
109
124
/* see https://github.com/gajus/eslint-plugin-jsdoc */
110
125
'jsdoc/no-undefined-types' : 'error' ,
0 commit comments