Skip to content

Instantly share code, notes, and snippets.

@MaffooBristol
Last active December 9, 2021 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaffooBristol/2314bedb6148f3b687625ffd619da35d to your computer and use it in GitHub Desktop.
Save MaffooBristol/2314bedb6148f3b687625ffd619da35d to your computer and use it in GitHub Desktop.
Typescript Eslint config files
extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:jest/recommended
- airbnb-base
- airbnb-base-typescript
plugins:
- '@typescript-eslint'
- '@typescript-eslint/eslint-plugin'
- jest
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2020
project: ['tsconfig.json']
rules:
space-before-function-paren: 2
brace-style: [2, 'stroustrup']
arrow-body-style: 0
no-underscore-dangle: 0
class-methods-use-this: 1
consistent-return: 0
no-unused-vars: 1
no-bitwise: 0
no-plusplus: 0
linebreak-style: 0
arrow-parens: [2, 'always']
no-useless-escape: 0
curly: [2, 'all']
no-lonely-if: 1
semi: 2
max-len: [1, { code: 120, ignoreComments: true }]
prefer-destructuring: 1
lines-between-class-members: 0
object-curly-newline: 0
indent: 2
no-console: 0
camelcase: 0
no-unreachable: 1
env:
browser: false
node: true
es6: true
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
{
"name": "eslint-typescript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest",
"test:watch": "jest --watch-all",
"lint": "eslint src/*.ts"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/preset-env": "^7.16.4",
"@babel/preset-typescript": "^7.16.0",
"@types/jest": "^27.0.3",
"@types/node": "^14.11.2",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"eslint": "^8.4.1",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-base-typescript": "^1.0.0",
"eslint-plugin-jest": "^25.3.0",
"jest": "^27.4.3",
"typescript": "^4.0.3"
}
}
{
"compilerOptions": {
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"declaration": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2018"],
"module": "commonjs",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"outDir": "build",
"rootDir": ".",
"sourceMap": true,
"strict": true,
"target": "es2018"
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment