Просмотр исходного кода

Merge pull request #5573 from overleaf/jpa-prefer-regex-literals

[misc] fix eslint violations for prefer-regex-literals

GitOrigin-RevId: 216288af22b9eeb18cddace7ec285e0a8046f94a
Jakob Ackermann 4 лет назад
Родитель
Сommit
638fbd5510

+ 0 - 5
services/chat/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/clsi/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/contacts/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/docstore/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/document-updater/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/filestore/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 1 - 1
services/filestore/test/acceptance/js/TestConfig.js

@@ -26,7 +26,7 @@ function gcsConfig() {
       apiScheme: process.env.GCS_API_SCHEME,
       apiScheme: process.env.GCS_API_SCHEME,
       projectId: 'fake',
       projectId: 'fake',
     },
     },
-    directoryKeyRegex: new RegExp('^[0-9a-fA-F]{24}/[0-9a-fA-F]{24}'),
+    directoryKeyRegex: /^[0-9a-fA-F]{24}\/[0-9a-fA-F]{24}/,
     unlockBeforeDelete: false, // fake-gcs does not support this
     unlockBeforeDelete: false, // fake-gcs does not support this
     deletedBucketSuffix: '-deleted',
     deletedBucketSuffix: '-deleted',
   }
   }

+ 0 - 5
services/notifications/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/real-time/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 0 - 5
services/spelling/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",

+ 1 - 1
services/spelling/app/js/ASpellWorker.js

@@ -113,7 +113,7 @@ class ASpellWorker {
 
 
     this.pipe.stdout.setEncoding('utf8') // ensure utf8 output is handled correctly
     this.pipe.stdout.setEncoding('utf8') // ensure utf8 output is handled correctly
     let output = ''
     let output = ''
-    const endMarkerRegex = new RegExp('^[a-z][a-z]', 'gm')
+    const endMarkerRegex = /^[a-z]{2}/gm
     this.pipe.stdout.on('data', data => {
     this.pipe.stdout.on('data', data => {
       // We receive the language code from Aspell as the end of data marker in
       // We receive the language code from Aspell as the end of data marker in
       // the data.  The input is a utf8 encoded string.
       // the data.  The input is a utf8 encoded string.

+ 0 - 5
services/track-changes/.eslintrc

@@ -20,11 +20,6 @@
     "mocha": true
     "mocha": true
   },
   },
   "rules": {
   "rules": {
-    // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671)
-    // START of temporary overrides
-    "prefer-regex-literals": "off",
-    // END of temporary overrides
-
     // Swap the no-unused-expressions rule with a more chai-friendly one
     // Swap the no-unused-expressions rule with a more chai-friendly one
     "no-unused-expressions": 0,
     "no-unused-expressions": 0,
     "chai-friendly/no-unused-expressions": "error",
     "chai-friendly/no-unused-expressions": "error",