ESLint config for TypeScript Library
- Indent with 2 spaces and always semicolon
- Best practice with
js
、ts
、react
or their bundle!
npm i -D eslint-config-typescript-library
# OR: npm install -D eslint eslint-config-typescript-library
In .eslintrc.js
:
module.exports = {
extends: ["eslint-config-typescript-library"],
};
This enable lint for both js
、ts
and react
! you'll also need typescript
as a devDependency at your project.
In .eslintrc.js
:
module.exports = {
extends: ["eslint-config-typescript-library/ts"],
};
You need specify --ext
explicitly to enable TypeScript linting:
{
"lint": "eslint src/** --ext .js,.jsx,.ts,.tsx --fix"
}
In .eslintrc.js
:
module.exports = {
extends: ["eslint-config-typescript-library/js"],
};
In .eslintrc.js
:
module.exports = {
extends: ["eslint-config-typescript-library/react"],
};
MIT © ULIVZ