@@ -2,16 +2,50 @@ import bpmnIoPlugin from 'eslint-plugin-bpmn-io';
22import reactHooksPlugin from 'eslint-plugin-react-hooks' ;
33import importPlugin from 'eslint-plugin-import' ;
44
5- const buildScripts = [ '*.js' , '*.mjs' ] ;
5+ const files = {
6+ build : [
7+ '*.js' ,
8+ '*.mjs' ,
9+ 'test/distro/distroSpec.js'
10+ ] ,
11+ test : [
12+ 'test/**/*.js'
13+ ] ,
14+ ignored : [
15+ 'dist' ,
16+ 'preact'
17+ ]
18+ } ;
19+
620
721export default [
822 {
9- ignores : [
10- 'dist'
11- ]
23+ ignores : files . ignored
1224 } ,
13- ...bpmnIoPlugin . configs . browser ,
14- ...bpmnIoPlugin . configs . jsx ,
25+
26+ // build
27+ ...bpmnIoPlugin . configs . node . map ( config => {
28+ return {
29+ ...config ,
30+ files : files . build
31+ } ;
32+ } ) ,
33+
34+ // lib + test
35+ ...bpmnIoPlugin . configs . browser . map ( config => {
36+ return {
37+ ...config ,
38+ ignores : files . build
39+ } ;
40+ } ) ,
41+ ...bpmnIoPlugin . configs . jsx . map ( config => {
42+ return {
43+ ...config ,
44+ ignores : files . build
45+ } ;
46+ } ) ,
47+
48+ // misc
1549 {
1650 plugins : {
1751 'react-hooks' : reactHooksPlugin ,
@@ -23,39 +57,30 @@ export default [
2357 'import/no-amd' : 'error' ,
2458 'import/no-webpack-loader-syntax' : 'error' ,
2559 'react-hooks/exhaustive-deps' : 'off'
60+ } ,
61+ ignores : files . build
62+ } ,
63+ {
64+ rules : {
65+ 'react/display-name' : 'off' ,
66+ 'react/no-unescaped-entities' : 'off'
2667 }
2768 } ,
28- ...bpmnIoPlugin . configs . node . map ( config => {
29- return {
30- ...config ,
31- files : [
32- ...buildScripts ,
33- '**/test/**/*.js'
34- ]
35- } ;
36- } ) ,
69+
70+ // test
3771 ...bpmnIoPlugin . configs . mocha . map ( config => {
3872 return {
3973 ...config ,
40- files : [
41- '**/test/**/*.js'
42- ]
74+ files : files . test
4375 } ;
4476 } ) ,
4577 {
4678 languageOptions : {
4779 globals : {
48- sinon : true
80+ sinon : true ,
81+ require : true
4982 } ,
5083 } ,
51- files : [
52- '**/test/**/*.js'
53- ]
54- } ,
55- {
56- rules : {
57- 'react/display-name' : 'off' ,
58- 'react/no-unescaped-entities' : 'off'
59- }
84+ files : files . test
6085 }
6186] ;
0 commit comments