https://github.com/phts/eslint-config
My config for ESLint
https://github.com/phts/eslint-config
eslint eslint-config npm-package
Last synced: 2 months ago
JSON representation
My config for ESLint
- Host: GitHub
- URL: https://github.com/phts/eslint-config
- Owner: phts
- Created: 2018-07-29T19:13:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-12T20:36:38.000Z (over 1 year ago)
- Last Synced: 2025-05-26T02:11:35.986Z (about 1 year ago)
- Topics: eslint, eslint-config, npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@phts/eslint-config
- Size: 1.49 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @phts/eslint-config
[](https://github.com/phts/eslint-config)
[](https://www.npmjs.com/package/@phts/eslint-config)
My config for ESLint.
## Install
```
$ npm i -D @phts/eslint-config
```
## Usage
### Basic rules
`.eslintrc.json`:
```json
{
"extends": "@phts"
}
```
### Prettier
```json
{
"extends": ["@phts", "@phts/eslint-config/addons/prettier"]
}
```
Enable support for Prettier via [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier) and [eslint-plugin-prettier](https://www.npmjs.com/package/eslint-plugin-prettier) for all `.js`, `.jsx`, `.ts`, `.tsx` files in the project.
Prettier must be installed manually:
```
$ npm i -D prettier
```
Make sure to put this addon **last**, so it gets the chance to override other configs.
### TypeScript
[@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser)
and [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) are used under the hood.
`.eslintrc.json`:
```json
{
"extends": ["@phts", "@phts/eslint-config/addons/typescript"]
}
```
`package.json`:
```json
{
"scripts": {
"lint": "eslint --ext .js,.ts,.tsx ."
}
}
```
SublimeText project:
```json
{
"folders": [
{
"path": "."
}
],
"settings": {
"SublimeLinter.linters.eslint.selector": "source.js, source.ts, source.tsx",
"SublimeLinter.linters.tslint.disable": true
}
}
```
VS Code workspace:
```json
{
"settings": {
// ...
"eslint.validate": ["typescript", "typescriptreact"]
}
}
```
### Other addons
configs
Enable Node.js environment for all combinations of config files
jest
Enable jest environment for test files
module
Enable ES-modules for .js files in src/ folder
node
Enable Node.js environment for all .js files
react
Enable support for react for .js and .jsx files in src/ folder
typescript/configs
Enable Node.js environment for all combinations of config files written in TypeScript
typescript/jest
Enable jest environment for test files
typescript/node
Enable Node.js environment for all .ts files
typescript/react
Enable support for react for .ts and .tsx files in src/ folder