Skip to content

Instantly share code, notes, and snippets.

@glektarssza
Last active June 18, 2024 13:49
Show Gist options
  • Save glektarssza/c025d873145f9f0557b88d075f45d2f2 to your computer and use it in GitHub Desktop.
Save glektarssza/c025d873145f9f0557b88d075f45d2f2 to your computer and use it in GitHub Desktop.
Typescript + ESlint Configs
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
};
//-- 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'
}
}
);
[
"@eslint/js",
"@types/eslint__js",
"eslint",
"eslint-config-prettier",
"eslint-plugin-prettier",
"eslint-plugin-tsdoc",
"prettier",
"prettier-eslint",
"typescript",
"typescript-eslint"
]
{
"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