https://github.com/euberdeveloper/eslint-config-typescript
My personal configuration for eslint with typescript
https://github.com/euberdeveloper/eslint-config-typescript
Last synced: 5 months ago
JSON representation
My personal configuration for eslint with typescript
- Host: GitHub
- URL: https://github.com/euberdeveloper/eslint-config-typescript
- Owner: euberdeveloper
- Archived: true
- Created: 2020-10-09T23:19:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-15T21:35:33.000Z (about 4 years ago)
- Last Synced: 2024-09-25T00:07:21.629Z (9 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @euberdeveloper/eslint-config-typescript
My personal eslint configuration when used with Typescript.
## Brief description
An eslint configuration, that uses the standard `@typescript-eslint/eslint-plugin` for the Typescript rules and
`eslint-plugin-mocha` for the mocha rules.
## How to use it### Install the dependencies:
```bash
# eslint with the typescript configuration
npm i -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser# eslint mocha plugin
npm i -D eslint-plugin-mocha# this eslint configuration
npm i -D @euberdeveloper/eslint-config-typescript
```### Add this `.eslintrc.js` file to your root:
```js
const path = require('path');module.exports = {
parserOptions: {
project: path.join(__dirname, 'tsconfig.json') // The path to your tsconfig.json
},
extends: [ '@euberdeveloper/typescript' ]
};
```### If you want to use it with prettier
Run this:
```bash
# prettier with its eslint connector
npm i -D prettier eslint-plugin-prettier eslint-config-prettier
```Add this `.prettierrc.js` file to your root:
```js
module.exports = {
tabWidth: 4,
singleQuote: true,
quoteProps: 'consistent',
trailingComma: 'none',
arrowParens: 'avoid',
printWidth: 120,
endOfLine: 'auto'
};
```Change the `.eslintrc.js` file to this:
```js
const path = require('path');module.exports = {
parserOptions: {
project: path.join(__dirname, 'tsconfig.json') // The path to your tsconfig.json
},
plugins: ['prettier'],
extends: [
'@euberdeveloper/typescript',
'plugin:prettier/recommended'
]
};
```### Now you can just use eslint to lint your code
You can also add some scripts to the `package.json` in order to have it always ready.