diff --git a/static-site/.eslintrc.yaml b/static-site/.eslintrc.yaml index 617c24770..77a519762 100644 --- a/static-site/.eslintrc.yaml +++ b/static-site/.eslintrc.yaml @@ -24,6 +24,11 @@ ignorePatterns: - public/ rules: + # The TypeScript compiler is able to handle usage of type definitions before + # they are defined. + no-use-before-define: off + "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "classes": false, "typedefs": false }] + react/prop-types: off # Remove this override once all props have been typed using PropTypes or TypeScript. '@next/next/no-img-element': off # Remove this if we use next.js optimisations for '@next/next/no-html-link-for-pages': off @@ -35,6 +40,16 @@ overrides: rules: '@typescript-eslint/no-var-requires': off + # React components can use variables before they are defined. + # This isn't great, as jsx/tsx doesn't imply React usage, but it avoids + # unnecessary workarounds such as: + # https://github.com/nextstrain/auspice/commit/af4c742f3855fa90ea292b4882293ebc66ace853 + - files: + - '**.[jt]sx' + rules: + no-use-before-define: off + "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }] + parserOptions: sourceType: module ecmaVersion: 2022