@betalectic-reusejs/shared-config-eslint-reactts
v1.0.1
Published
Betalectic's Eslint configuration for React Typescript Projects
Downloads
35
Readme
Steps to setup EsLint React TypeScript
- Add Following packages as dev-dependencies:
eslint
@betalectic-reusejs/shared-config-eslint-reactts
eslint-plugin-react
eslint-plugin-standard
eslint-plugin-prettier
@typescript-eslint/parser
@typescript-eslint/eslint-plugin
Run Following Command to do so:
yarn add eslint @betalectic-reusejs/shared-config-eslint-reactts eslint-plugin-react eslint-plugin-standard eslint-plugin-prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin -D
'or'
yarn add --dev eslint @betalectic-reusejs/shared-config-eslint-reactts eslint-plugin-react eslint-plugin-standard eslint-plugin-prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin
- Now create a new file called
.eslintrc.js
in your project root, and add following code fragment to the file
module.exports = {
extends: ["@betalectic-reusejs/shared-config-eslint-reactts"],
};
- In your package .json create a lint script as shown below:
"lint": "yarn eslint '**/*.ts' '**/*.tsx'",
You have to give the target for the linting, here our sample project have ts
and tsx
files so we give these file(all with given extension) as target for linting.
node_modules is automatically ignored in our package, you can add other ignore options by using
ignorePatterns: ["dist/"]
in.eslintrc.cjs
or pass it in lint script asyarn eslint '**/*.js' --ignore-pattern 'dist/'