This repository has been archived by the owner on Oct 8, 2023. It is now read-only.
generated from Tim-W-James/frontend-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8704838
commit 28574cd
Showing
10 changed files
with
9,792 additions
and
4,562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,194 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "./tsconfig.json", | ||
sourceType: "module", | ||
ecmaVersion: "latest", | ||
ecmaFeatures: { | ||
impliedStrict: true, | ||
jsx: true, | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/jsx-runtime", | ||
"plugin:react/recommended", | ||
"plugin:import/recommended", | ||
"airbnb-typescript", | ||
"airbnb/hooks", | ||
"plugin:sonarjs/recommended", | ||
"plugin:jsx-a11y/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:storybook/recommended", | ||
"./.eslintrc-auto-import.json", | ||
], | ||
plugins: [ | ||
"react", | ||
"@typescript-eslint", | ||
"sonarjs", | ||
"jsx-a11y", | ||
"prettier", | ||
"vitest", | ||
"prefer-arrow-functions", | ||
], | ||
// Ignore files in root | ||
ignorePatterns: ["/*.*"], | ||
settings: { | ||
react: { | ||
createClass: "createReactClass", | ||
// Regex for Component Factory to use | ||
pragma: "React", | ||
// Pragma to use, default to "React" | ||
fragment: "Fragment", | ||
// Fragment to use (may be a property of <pragma>), default to "Fragment" | ||
version: "detect", | ||
// React version. "detect" automatically picks the version you have installed. | ||
flowVersion: "0.53", // Flow version | ||
}, | ||
propWrapperFunctions: [ | ||
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped. | ||
"forbidExtraProps", | ||
{ | ||
property: "freeze", | ||
object: "Object", | ||
}, | ||
{ | ||
property: "myFavoriteWrapper", | ||
}, // for rules that check exact prop wrappers | ||
{ | ||
property: "forbidExtraProps", | ||
exact: true, | ||
}, | ||
], | ||
componentWrapperFunctions: [ | ||
// The name of any function used to wrap components, e.g. Mobx `observer` function. If this isn't set, components wrapped by these functions will be skipped. | ||
"observer", // `property` | ||
{ | ||
property: "styled", | ||
}, // `object` is optional | ||
{ | ||
property: "observer", | ||
object: "Mobx", | ||
}, | ||
{ | ||
property: "observer", | ||
object: "<pragma>", | ||
}, // sets `object` to whatever value `settings.react.pragma` is set to | ||
], | ||
formComponents: [ | ||
// Components used as alternatives to <form> for forms, eg. <Form endpoint={ url } /> | ||
"CustomForm", | ||
{ | ||
name: "Form", | ||
formAttribute: "endpoint", | ||
}, | ||
], | ||
linkComponents: [ | ||
// Components used as alternatives to <a> for linking, eg. <Link to={ url } /> | ||
"Hyperlink", | ||
{ | ||
name: "Link", | ||
linkAttribute: "to", | ||
}, | ||
], | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-unused-expressions": [ | ||
"error", | ||
{ | ||
allowShortCircuit: true, | ||
allowTernary: true, | ||
}, | ||
], | ||
"react/prefer-stateless-function": "error", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
// allow devDependencies to be imported into testing files, etc. | ||
{ devDependencies: ["**/*.{test,spec,story,stories}.{ts,tsx}"] }, | ||
], | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
argsIgnorePattern: "^_", | ||
}, | ||
], | ||
"require-await": "warn", | ||
"prefer-arrow-functions/prefer-arrow-functions": [ | ||
"warn", | ||
{ | ||
classPropertiesAllowed: true, | ||
disallowPrototype: true, | ||
returnStyle: "unchanged", | ||
}, | ||
], | ||
"arrow-body-style": "warn", | ||
"prefer-arrow-callback": [ | ||
"warn", | ||
{ | ||
allowNamedFunctions: true, | ||
}, | ||
], | ||
"react/self-closing-comp": "warn", | ||
"react/jsx-sort-props": "warn", | ||
"@typescript-eslint/switch-exhaustiveness-check": "warn", | ||
"@typescript-eslint/naming-convention": [ | ||
"warn", | ||
{ | ||
selector: "default", | ||
format: ["camelCase"], | ||
}, | ||
{ | ||
selector: "variable", | ||
format: ["PascalCase", "camelCase", "UPPER_CASE"], | ||
}, | ||
{ | ||
selector: "parameter", | ||
format: ["camelCase"], | ||
leadingUnderscore: "allow", | ||
}, | ||
{ | ||
selector: "memberLike", | ||
modifiers: ["private"], | ||
format: ["camelCase"], | ||
leadingUnderscore: "require", | ||
}, | ||
{ | ||
selector: "typeLike", | ||
format: ["PascalCase"], | ||
}, | ||
], | ||
"max-len": [ | ||
"warn", | ||
{ | ||
code: 80, | ||
tabWidth: 2, | ||
ignoreUrls: true, | ||
ignoreRegExpLiterals: true, | ||
}, | ||
], | ||
curly: "warn", | ||
"object-shorthand": "warn", | ||
"@typescript-eslint/no-shadow": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/quotes": "off", | ||
"@typescript-eslint/comma-dangle": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react/jsx-one-expression-per-line": "off", | ||
"react/prop-types": "off", | ||
}, | ||
overrides: [ | ||
{ | ||
// overrides for tests | ||
files: ["*.test.{ts,tsx}"], | ||
}, | ||
{ | ||
// override for storybook | ||
files: ["*.{stories,story}.{ts,tsx}"], | ||
}, | ||
], | ||
extends: ["@tim-w-james", "./.eslintrc-auto-import.json"], | ||
plugins: ["vitest"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
plugins: { | ||
autoprefixer: {}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.