Last active
June 18, 2024 13:49
-
-
Save glektarssza/c025d873145f9f0557b88d075f45d2f2 to your computer and use it in GitHub Desktop.
Typescript + ESlint Configs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
arrowParens: "always", | |
bracketSameLine: true, | |
bracketSpacing: false, | |
endOfLine: "lf", | |
htmlWhitespaceSensitivity: "css", | |
jsxSingleQuote: true, | |
overrides: [ | |
{ | |
files: [ | |
"*.{yml,yaml}" | |
], | |
options: { | |
tabWidth: 2 | |
} | |
} | |
], | |
printWidth: 80, | |
proseWrap: "preserve", | |
quoteProps: "as-needed", | |
semi: true, | |
singleQuote: true, | |
trailingComma: "none", | |
useTabs: false, | |
tabWidth: 4, | |
vueIndentScriptAndStyle: true | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-- NPM Packages | |
import eslint from '@eslint/js'; | |
import tseslint from 'typescript-eslint'; | |
import prettierPlugin from 'eslint-plugin-prettier/recommended'; | |
export default tseslint.config( | |
{ | |
extends: [ | |
eslint.configs.recommended, | |
...tseslint.configs.recommendedTypeChecked, | |
prettierPlugin | |
], | |
files: ['**/*.ts'], | |
ignores: ['**/dist/**'], | |
languageOptions: { | |
parserOptions: { | |
projectService: true, | |
tsconfigRootDir: import.meta.dirname | |
} | |
} | |
}, | |
{ | |
files: ['**/tests/**/*.ts'], | |
rules: { | |
'@typescript-eslint/no-unused-expressions': 'off', | |
'@typescript-eslint/unbound-method': 'off' | |
} | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"@eslint/js", | |
"@types/eslint__js", | |
"eslint", | |
"eslint-config-prettier", | |
"eslint-plugin-prettier", | |
"eslint-plugin-tsdoc", | |
"prettier", | |
"prettier-eslint", | |
"typescript", | |
"typescript-eslint" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"allowSyntheticDefaultImports": true, | |
"allowUnreachableCode": false, | |
"allowUnusedLabels": false, | |
"alwaysStrict": true, | |
"emitDecoratorMetadata": true, | |
"esModuleInterop": true, | |
"exactOptionalPropertyTypes": true, | |
"experimentalDecorators": true, | |
"forceConsistentCasingInFileNames": true, | |
"incremental": true, | |
"inlineSourceMap": true, | |
"inlineSources": true, | |
"module": "CommonJS", | |
"moduleResolution": "Node", | |
"newLine": "LF", | |
"noEmitOnError": true, | |
"noErrorTruncation": true, | |
"noFallthroughCasesInSwitch": true, | |
"noImplicitAny": true, | |
"noImplicitOverride": true, | |
"noImplicitReturns": true, | |
"noImplicitThis": true, | |
"noPropertyAccessFromIndexSignature": true, | |
"noStrictGenericChecks": false, | |
"noUncheckedIndexedAccess": true, | |
"noUnusedLocals": true, | |
"noUnusedParameters": true, | |
"pretty": true, | |
"removeComments": true, | |
"resolveJsonModule": false, | |
"strict": true, | |
"strictBindCallApply": true, | |
"strictFunctionTypes": true, | |
"strictNullChecks": true, | |
"strictPropertyInitialization": true, | |
"suppressExcessPropertyErrors": false, | |
"suppressImplicitAnyIndexErrors": false, | |
"target": "ES2018", | |
"useDefineForClassFields": true, | |
"useUnknownInCatchVariables": true | |
}, | |
"exclude": [ | |
"node_modules" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment