Skip to content

Instantly share code, notes, and snippets.

@apetersson
Created November 16, 2025 11:17
Show Gist options
  • Select an option

  • Save apetersson/eacc00732d5449c878c8a1263333ddd6 to your computer and use it in GitHub Desktop.

Select an option

Save apetersson/eacc00732d5449c878c8a1263333ddd6 to your computer and use it in GitHub Desktop.
.eslintrc.cjs:
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
ignorePatterns: ["src/generated/**", "src/contracts/**"],
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module"
},
rules: {
quotes: "off",
"prettier/prettier": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"prefer-const": "warn",
// "@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/consistent-type-definitions": ["warn", "type"],
"@typescript-eslint/no-explicit-any": ["error"],
// "@typescript-eslint/strict-boolean-expressions": "warn",
// "@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"decorator-optional-consistency": "error",
"no-decimal-to-string": "error"
},
overrides: [
{
files: ["*.d.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
files: ["*Dto.ts"],
rules: {
"@typescript-eslint/strict-boolean-expressions": "off"
}
}
],
settings: {}
};
.prettierrc
{
"singleQuote": false,
"trailingComma": "none",
"printWidth": 120,
"tabWidth": 2,
"semi": true,
"jsxSingleQuote": false,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
tsconfig.json:
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"strictNullChecks": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"baseUrl": "./src",
"typeRoots": [
"./node_modules/@types",
"./src/types"
],
"paths": {
"@components/*": [
"components/*"
],
"@containers/*": [
"containers/*"
],
"@utils/*": [
"utils/*"
],
"@hooks/*": [
"hooks/*"
],
"@assets/*": [
"assets/*"
],
"@libs/*": [
"libs/*"
],
"@i18n/*": [
"i18n/*"
],
"@routes/*": [
"routes/*"
],
"@contracts/*": [
"contracts/*"
]
}
},
"include": [
"src",
"jest.setup.ts"
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
}
tsconfig.node.json:
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment