Browse Source

refs #84709: add test and lint
add eslint regex plugin to global

NEEDLEMAN3\tatsu 4 years ago
parent
commit
7997a2f09c

+ 10 - 0
.eslintrc.js

@@ -12,6 +12,7 @@ module.exports = {
   },
   },
   plugins: [
   plugins: [
     'jest',
     'jest',
+    'regex',
   ],
   ],
   rules: {
   rules: {
     'import/prefer-default-export': 'off',
     'import/prefer-default-export': 'off',
@@ -30,5 +31,14 @@ module.exports = {
       'error',
       'error',
       { additionalTestBlockFunctions: ['each.test'] },
       { additionalTestBlockFunctions: ['each.test'] },
     ],
     ],
+    'regex/invalid': ['error', [
+      {
+        regex: '\\?\\<\\!',
+        message: 'Do not use any negative lookbehind',
+      }, {
+        regex: '\\?\\<\\=',
+        message: 'Do not use any Positive lookbehind',
+      },
+    ]],
   },
   },
 };
 };

+ 3 - 1
packages/codemirror-textlint/package.json

@@ -10,7 +10,9 @@
     "lint": "eslint src --ext .ts",
     "lint": "eslint src --ext .ts",
     "lint:fix": "eslint src --ext .ts --fix"
     "lint:fix": "eslint src --ext .ts --fix"
   },
   },
-  "dependencies": {},
+  "dependencies": {
+    "eslint-plugin-regex": "^1.8.0"
+  },
   "devDependencies": {
   "devDependencies": {
     "@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.8",
     "@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.8",
     "@textlint/kernel": "^12.0.2",
     "@textlint/kernel": "^12.0.2",

+ 3 - 2
packages/core/package.json

@@ -19,6 +19,7 @@
     "lint": "npm-run-all -p lint:*",
     "lint": "npm-run-all -p lint:*",
     "test": "jest --verbose"
     "test": "jest --verbose"
   },
   },
-  "dependencies": {},
-  "devDependencies": {}
+  "dependencies": {
+    "eslint-plugin-regex": "^1.8.0"
+  }
 }
 }

+ 1 - 0
packages/plugin-attachment-refs/package.json

@@ -24,6 +24,7 @@
   "dependencies": {
   "dependencies": {
     "browser-bunyan": "^1.6.3",
     "browser-bunyan": "^1.6.3",
     "bunyan": "^1.8.15",
     "bunyan": "^1.8.15",
+    "eslint-plugin-regex": "^1.8.0",
     "http-errors": "^1.8.0",
     "http-errors": "^1.8.0",
     "react-images": "~1.0.0",
     "react-images": "~1.0.0",
     "react-motion": "^0.5.2",
     "react-motion": "^0.5.2",

+ 3 - 1
packages/plugin-lsx/package.json

@@ -21,7 +21,9 @@
     "lint": "run-p lint:*",
     "lint": "run-p lint:*",
     "test": ""
     "test": ""
   },
   },
-  "dependencies": {},
+  "dependencies": {
+    "eslint-plugin-regex": "^1.8.0"
+  },
   "devDependencies": {
   "devDependencies": {
     "react": "^16.8.3",
     "react": "^16.8.3",
     "react-dom": "^16.8.3"
     "react-dom": "^16.8.3"

+ 3 - 0
packages/plugin-pukiwiki-like-linker/package.json

@@ -23,5 +23,8 @@
   "devDependencies": {
   "devDependencies": {
     "browser-bunyan": "^1.6.3",
     "browser-bunyan": "^1.6.3",
     "tsc-alias": "^1.2.9"
     "tsc-alias": "^1.2.9"
+  },
+  "dependencies": {
+    "eslint-plugin-regex": "^1.8.0"
   }
   }
 }
 }

+ 1 - 0
packages/slack/package.json

@@ -17,6 +17,7 @@
     "axios": "^0.24.0",
     "axios": "^0.24.0",
     "browser-bunyan": "^1.6.3",
     "browser-bunyan": "^1.6.3",
     "bunyan": "^1.8.15",
     "bunyan": "^1.8.15",
+    "eslint-plugin-regex": "^1.8.0",
     "extensible-custom-error": "^0.0.7",
     "extensible-custom-error": "^0.0.7",
     "http-errors": "^1.8.0",
     "http-errors": "^1.8.0",
     "universal-bunyan": "^0.9.2",
     "universal-bunyan": "^0.9.2",

+ 1 - 0
packages/slackbot-proxy/package.json

@@ -39,6 +39,7 @@
     "compression": "^1.7.4",
     "compression": "^1.7.4",
     "cookie-parser": "^1.4.5",
     "cookie-parser": "^1.4.5",
     "date-fns": "^2.23.0",
     "date-fns": "^2.23.0",
+    "eslint-plugin-regex": "^1.8.0",
     "express-bunyan-logger": "^1.3.3",
     "express-bunyan-logger": "^1.3.3",
     "extensible-custom-error": "^0.0.7",
     "extensible-custom-error": "^0.0.7",
     "helmet": "^4.6.0",
     "helmet": "^4.6.0",

+ 3 - 1
packages/ui/package.json

@@ -15,7 +15,9 @@
     "lint": "npm-run-all -p lint:*",
     "lint": "npm-run-all -p lint:*",
     "test": "jest --verbose"
     "test": "jest --verbose"
   },
   },
-  "dependencies": {},
+  "dependencies": {
+    "eslint-plugin-regex": "^1.8.0"
+  },
   "devDependencies": {
   "devDependencies": {
     "react": "^16.8.3"
     "react": "^16.8.3"
   }
   }