@@ -21,58 +21,70 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
2121
2222/**
2323 * @type {import('eslint').Linter.Config }
24- * @see { @link https://eslint.org/}
24+ * @see https://eslint.org/
2525 */
2626module . exports = {
2727 root : true ,
2828 plugins : [
2929 /* see https://github.com/lydell/eslint-plugin-simple-import-sort#readme */
3030 'simple-import-sort' ,
3131 /* see https://github.com/Stuk/eslint-plugin-header#readme */
32- 'header'
32+ 'header' ,
33+ /* see https://github.com/phanect/eslint-plugin-editorconfig */
34+ 'editorconfig'
3335 ] ,
3436 env : {
3537 commonjs : true ,
3638 browser : true ,
3739 node : true
3840 } ,
41+ extends : [
42+ /* see https://github.com/phanect/eslint-plugin-editorconfig */
43+ 'plugin:editorconfig/all'
44+ ] ,
3945 rules : {
4046 // region sort imports/exports
4147 /* 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' ,
4450 /* see https://github.com/lydell/eslint-plugin-simple-import-sort/ */
4551 'simple-import-sort/imports' : 'error' ,
4652 'simple-import-sort/exports' : 'error' ,
4753 // endregion sort imports/exports
4854 // region license-header
4955 /* see https://github.com/Stuk/eslint-plugin-header#readme */
50- 'header/header' : [ 'error' , './.license-header.js' ]
56+ 'header/header' : [ 'error' , './.license-header.js' ] ,
5157 // endregion license-header
58+ // indent is managed by plugin '*standard'
59+ 'editorconfig/indent' : 'off'
5260 } ,
5361 overrides : [
62+ {
63+ files : [ '*.node.*' ] ,
64+ env : { browser : false , node : true }
65+ } ,
66+ {
67+ files : [ '*.web.*' ] ,
68+ env : { browser : true , node : false }
69+ } ,
5470 {
5571 files : [ '*.spec.*' , '*.test.*' ] ,
5672 env : {
5773 mocha : true ,
58- commonjs : true ,
5974 node : true ,
6075 browser : false // change, when mocha is enabled for browser
6176 }
6277 } ,
6378 {
6479 files : [ '*.ts' ] ,
65- extends : [
66- /* see https://github.com/standard/ts-standard */
67- 'standard-with-typescript'
68- ] ,
6980 plugins : [
7081 /* see https://github.com/microsoft/tsdoc */
7182 'eslint-plugin-tsdoc'
7283 ] ,
73- parserOptions : {
74- project : './tsconfig.json'
75- } ,
84+ extends : [
85+ /* see https://github.com/standard/ts-standard */
86+ 'standard-with-typescript'
87+ ] ,
7688 rules : {
7789 // region override rules from plugin 'standard-with-typescript'
7890 /* @see https://typescript-eslint.io/rules/consistent-type-imports/ */
@@ -91,20 +103,23 @@ module.exports = {
91103 /* see https://github.com/microsoft/tsdoc */
92104 'tsdoc/syntax' : 'error'
93105 // endregion docs
106+ } ,
107+ parserOptions : {
108+ project : './tsconfig.json'
94109 }
95110 } ,
96111 {
97112 files : [ '*.js' , '*.mjs' , '*.cjs' ] ,
113+ plugins : [
114+ /* see https://github.com/gajus/eslint-plugin-jsdoc/ */
115+ 'jsdoc'
116+ ] ,
98117 extends : [
99118 /* see https://www.npmjs.com/package/eslint-config-standard */
100119 'standard' ,
101120 /* see https://github.com/gajus/eslint-plugin-jsdoc */
102121 'plugin:jsdoc/recommended'
103122 ] ,
104- plugins : [
105- /* see https://github.com/gajus/eslint-plugin-jsdoc/ */
106- 'jsdoc'
107- ] ,
108123 rules : {
109124 /* see https://github.com/gajus/eslint-plugin-jsdoc */
110125 'jsdoc/no-undefined-types' : 'error' ,
0 commit comments