Explorar el Código

eslint naming conventions modified

Gleb Urvanov hace 4 años
padre
commit
67d17093d0
Se han modificado 1 ficheros con 30 adiciones y 0 borrados
  1. 30 0
      devops/eslint-config/index.js

+ 30 - 0
devops/eslint-config/index.js

@@ -43,6 +43,36 @@ module.exports = {
     // should prefer using 'debug' package at least to allow control of
     // output verbosity if logging to console.
     'no-console': 'off',
+    '@typescript-eslint/camelcase': 'off',
+    '@typescript-eslint/class-name-casing': 'off',
+    "@typescript-eslint/naming-convention": [
+      "error",
+      {
+        selector: 'default',
+        format: ['camelCase'],
+      },
+      {
+        selector: 'variable',
+        format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
+      },
+      {
+        selector: 'property',
+        format: [] // Don't force format of object properties, so they can be ie.: { "Some thing": 123 }, { some_thing: 123 } etc.
+      },
+      {
+        selector: 'accessor',
+        format: ['camelCase', 'snake_case']
+      },
+      {
+        selector: 'enumMember',
+        format: ['PascalCase']
+      },
+      {
+        selector: 'typeLike',
+        format: [],
+        custom: { regex: '^([A-Z][a-z0-9]*_?)+', match: true }, // combined PascalCase and snake_case to allow ie. OpeningType_Worker
+      }
+    ],
   },
   plugins: [
     'standard',