-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add React with Typescript target
- Loading branch information
Showing
5 changed files
with
165 additions
and
24 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = { | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
|
||
env: { | ||
browser: true, | ||
es6: true, | ||
node: false, | ||
}, | ||
|
||
extends: [ | ||
...[ | ||
"../rules/best.practices", | ||
"../rules/comments", | ||
"../rules/errors", | ||
"../rules/es6", | ||
"../rules/html", | ||
"../rules/import", | ||
"../rules/import-ts", | ||
"../rules/jsdoc", | ||
"../rules/promise", | ||
"../rules/react", | ||
"../rules/style", | ||
"../rules/unicorn", | ||
"../rules/variables", | ||
"../rules/prettier", | ||
].map(require.resolve), | ||
|
||
// Disable ESLint rules from @typescript-eslint/eslint-plugin that | ||
// conflict with prettier | ||
"prettier/@typescript-eslint", | ||
|
||
"plugin:@typescript-eslint/recommended", | ||
], | ||
|
||
plugins: ["json", "no-inferred-method-name"], | ||
|
||
ignorePatterns: ["dist/*.js", "*.d.ts"], | ||
|
||
rules: { | ||
"react/prop-types": "off", | ||
|
||
// Ensure JSDoc comments are valid | ||
"valid-jsdoc": [ | ||
"error", | ||
{ | ||
requireReturn: false, | ||
requireReturnDescription: false, | ||
requireReturnType: true, | ||
}, | ||
], | ||
|
||
"@typescript-eslint/no-var-requires": "off", | ||
|
||
// Disable, it gives false positives. let eslint/no-unused-vars | ||
"@typescript-eslint/no-unused-vars": "off", | ||
|
||
// Restrict file extensions that may contain JSX | ||
"react/jsx-filename-extension": [ | ||
"error", | ||
{ extensions: [".js", ".jsx", ".tsx", ".ts"] }, | ||
], | ||
|
||
// Let Typescript handle it | ||
"@typescript-eslint/no-use-before-define": "error", | ||
"no-use-before-define": "off", | ||
|
||
/* | ||
* A list of file extensions that will be parsed as modules and | ||
* inspected for exports. | ||
*/ | ||
"import/extensions": [ | ||
"error", | ||
"always", | ||
{ | ||
js: "never", | ||
ts: "never", | ||
jsx: "never", | ||
tsx: "never", | ||
}, | ||
], | ||
|
||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
args: "after-used", | ||
varsIgnorePattern: "debug", | ||
}, | ||
], | ||
}, | ||
|
||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
|
||
/* | ||
* A list of regex strings that, if matched by a path, will not report | ||
* the matching module if no exports are found. | ||
*/ | ||
"import/ignore": [".(sass|scss|less|css)$"], | ||
|
||
/* | ||
* A list of file extensions that will be parsed as modules and | ||
* inspected for exports. | ||
*/ | ||
"import/extensions": [ | ||
"error", | ||
"always", | ||
{ | ||
js: "never", | ||
ts: "never", | ||
jsx: "never", | ||
tsx: "never", | ||
}, | ||
], | ||
|
||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
args: "after-used", | ||
varsIgnorePattern: "debug", | ||
}, | ||
], | ||
}, | ||
} |
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