https://github.com/mtth/eslint-plugin
ESLint configuration for TypeScript
https://github.com/mtth/eslint-plugin
eslint typescript
Last synced: 5 months ago
JSON representation
ESLint configuration for TypeScript
- Host: GitHub
- URL: https://github.com/mtth/eslint-plugin
- Owner: mtth
- License: mit
- Created: 2021-02-13T18:29:49.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T23:58:59.000Z (over 1 year ago)
- Last Synced: 2025-03-30T09:03:40.336Z (about 1 year ago)
- Topics: eslint, typescript
- Language: JavaScript
- Homepage:
- Size: 281 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESLint plugin
Shared linting configuration.
## Quickstart
First, install ESLint and this plugin:
```sh
$ npm i -D eslint @mtth/eslint-plugin
```
Then reference this plugin in `.eslintrc.js`:
```js
module.exports = {
plugins: ['@mtth'],
extends: ['plugin:@mtth/typescript'], // One of the configurations below.
// Project-specific configuration...
};
```
## Configurations
+ `typescript`, defaults for a TypeScript project. The corresponding parser is
included in the plugin.
## Next steps
This plugin is best used in combination with [this prettier
configuration](https://github.com/mtth/prettier-typescript) and the following
convenience scripts:
```json
{
"fix": "npm run pretty && npm run lint -- --fix",
"lint": "eslint '{src,test}/**/*.{ts,tsx}'",
"pretty": "prettier --write '{src,test}/**/*.{ts,tsx}'"
}
```
We also recommend enabling pre-commit hooks with `husky` and `lint-staged`. For
example, within your `package.json`:
```json
{
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.ts": [
"prettier --write",
"eslint --fix"
]
}
}
```