Skip to content

Commit

Permalink
eslint: Add custom rules
Browse files Browse the repository at this point in the history
James went through all the rules that we had custom-enabled prior to
b3cedb7. These are the ones that were
flagged to be re-added.

Some are commented out since there are existing violations. Subsequent
commits will un-comment the rules and address violations.

Co-authored-by: James Hadfield <hadfield.james@gmail.com>
  • Loading branch information
victorlin and jameshadfield committed May 4, 2023
1 parent a9aab1d commit 71c0709
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ globals:
rules:
# Code quality rules
no-unused-vars: ["error", { "argsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }]
# no-use-before-define: ["error", { "functions": false }]
# prefer-const: ["error", {"destructuring": "all"}]
react/prop-types: off # Remove this override once all props have been typed using PropTypes or TypeScript.

# Code style rules
arrow-parens: ["error", "always"]
# no-unneeded-ternary: ["error", { "defaultAssignment": true }]
operator-linebreak: ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]
quote-props: ["error", "as-needed"]

parserOptions:
ecmaVersion: 6
Expand Down
3 changes: 3 additions & 0 deletions src/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

rules:
react/jsx-filename-extension: [1, { "extensions": [".js", ".jsx"] }]

# Code quality rules
# no-console: [1, { "allow": ["warn", "error"] }]

0 comments on commit 71c0709

Please sign in to comment.