Skip to content

Commit

Permalink
new rules (#12200)
Browse files Browse the repository at this point in the history
Former-commit-id: 83ff9566ee9ebf49c5bc5db41d9bcc6a226aa0d0
  • Loading branch information
RaananW authored Mar 18, 2022
1 parent 42b2c60 commit 69df67a
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/**/*.*
.snapshot/**/*.*
# temp
**/tests/**/*.*
88 changes: 80 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
// All the @typescript-eslint/* rules here...
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"tsdoc/syntax": "error"
"@typescript-eslint/prefer-optional-chain": "error"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down Expand Up @@ -74,20 +73,93 @@
// "react/self-closing-comp": "error",
"import/no-unresolved": "off",
// should be error, no?
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"],
"leadingUnderscore": "allow"
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "enumMember",
"format": ["PascalCase", "UPPER_CASE"]
},
{
"selector": "memberLike",
"modifiers": ["public", "static"],
"format": ["PascalCase", "UPPER_CASE"],
"leadingUnderscore": "allow"
},
{
"selector": "memberLike",
"modifiers": ["private", "static"],
"format": ["PascalCase", "UPPER_CASE"],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": ["public"],
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": ["protected"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "interface",
"format": ["PascalCase"]
}
],
"no-unused-vars": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"space-infix-ops": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"jest/no-standalone-expect": ["error", { "additionalTestBlockFunctions": ["afterEach"] }],
"jest/valid-expect": "off",
"tsdoc/syntax": "warn",
"jsdoc/check-param-names": "error",
// "tsdoc/syntax": "error",
"jsdoc/check-param-names": "warn",
"jsdoc/check-property-names": "error",
"jsdoc/require-param": "error",
"jsdoc/require-param-name": "error",
"jsdoc/require-returns": "error"
// "jsdoc/require-returns": "warn",
// "jsdoc/require-returns-check": "error",
"import/export": "warn",
"no-useless-escape": "warn",
"no-case-declarations": "warn",
"no-prototype-builtins": "warn",
"no-loss-of-precision": "warn",
"prefer-spread": "warn",
"prefer-rest-params": "warn",
"no-fallthrough": "warn",
"no-async-promise-executor": "warn"
// "prettier/prettier": "error" // add this if we want to use prettier error reporting.
}
}
}

0 comments on commit 69df67a

Please sign in to comment.