0.3.0 • Published 2 years ago
eslint-config-typescript-library v0.3.0
eslint-config-typescript-library
ESLint config for TypeScript Library
Features
- Indent with 2 spaces and always semicolon
- Best practice with
js、ts、reactor their bundle!
Install
npm i -D eslint-config-typescript-library
# OR: npm install -D eslint eslint-config-typescript-libraryUsage
Lint All
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.
Lint TypeScript
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"
}Lint JavaScript
In .eslintrc.js:
module.exports = {
extends: ["eslint-config-typescript-library/js"],
};Lint React
In .eslintrc.js:
module.exports = {
extends: ["eslint-config-typescript-library/react"],
};License
MIT © ULIVZ