Skip to content

Instantly share code, notes, and snippets.

@asherccohen
Created February 27, 2024 20:22
Show Gist options
  • Save asherccohen/a4bce360b21b6e086064a3f8d62af3a9 to your computer and use it in GitHub Desktop.
Save asherccohen/a4bce360b21b6e086064a3f8d62af3a9 to your computer and use it in GitHub Desktop.
{
"root": true,
"plugins": [
"@nx",
"prettier",
"prefer-arrow",
"simple-import-sort",
"fp-ts-strict",
"fp"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"parserOptions": {},
"rules": {
"import/order": "off",
"import/no-extraneous-dependencies": [
"off",
{
"devDependencies": [
"**/*.stories.tsx",
"**/*.test.ts{,x}",
"src/setupTests.ts",
"src/mocks/*",
"cypress/plugins/index.ts",
"cypress/support/commands.ts"
]
}
],
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": ["state", "acc"]
}
],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"id-blacklist": ["error", "any", "number", "string", "boolean"],
"import/no-internal-modules": "off",
"no-plusplus": [
"error",
{
"allowForLoopAfterthoughts": true
}
],
"no-redeclare": [
"error",
{
"builtinGlobals": true
}
],
"prefer-arrow/prefer-arrow-functions": [
"warn",
{
"disallowPrototype": true,
"singleReturnOnly": true,
"classPropertiesAllowed": false
}
],
"prettier/prettier": "warn",
"quote-props": ["error", "as-needed"],
"react/button-has-type": ["warn"],
"react/jsx-key": "error",
"react/jsx-props-no-spreading": [
"error",
{
"html": "ignore",
"custom": "ignore",
"exceptions": [""]
}
],
"react/state-in-constructor": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-no-useless-fragment": "off",
"react/no-array-index-key": "error",
"react/no-unstable-nested-components": [
"error",
{
"allowAsProps": true,
"customValidators": []
}
],
"valid-typeof": "off",
"@typescript-eslint/no-floating-promises": "error",
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
},
{
"sourceTag": "frontend",
"bannedExternalImports": [
"lodash",
"@radix-ui/*",
"react-hook-form",
"react-table"
]
}
]
}
],
"no-console": ["warn"],
"fp-ts-strict/record-lookup": ["off"],
"fp-ts-strict/option-over-null": ["off"],
"fp-ts-strict/option-over-undefined": ["off"],
"fp/no-arguments": "off",
"fp/no-class": "warn",
"fp/no-delete": "off",
"fp/no-events": "off",
"fp/no-get-set": "off",
"fp/no-let": "off",
"fp/no-loops": "off",
"fp/no-mutating-assign": "off",
"fp/no-mutating-methods": "off",
"fp/no-mutation": "off",
"fp/no-nil": "off",
"fp/no-proxy": "off",
"fp/no-rest-parameters": "off",
"fp/no-this": "off",
"fp/no-throw": "off",
"fp/no-unused-expression": "off",
"fp/no-valueof-field": "off",
"no-var": "off",
// "fp-ts-strict/record-lookup": ["off"],
// "fp-ts-strict/option-over-null": ["off"],
// "fp-ts-strict/option-over-undefined": ["off"],
// "fp/no-arguments": "error",
// "fp/no-class": "warn",
// "fp/no-delete": "error",
// "fp/no-events": "error",
// "fp/no-get-set": "error",
// "fp/no-let": "off",
// "fp/no-loops": "warn",
// "fp/no-mutating-assign": "error",
// "fp/no-mutating-methods": "warn",
// "fp/no-mutation": "off",
// "fp/no-nil": "off",
// "fp/no-proxy": "error",
// "fp/no-rest-parameters": "off",
// "fp/no-this": "error",
// "fp/no-throw": "error",
// "fp/no-unused-expression": "off",
// "fp/no-valueof-field": "error",
// "no-var": "error"
"no-magic-numbers": [
"off",
{
"enforceConst": true
}
],
"camelcase": "warn",
"complexity": ["error", 40],
"consistent-return": ["error"],
"curly": "error",
"default-case": "error",
"no-alert": "error",
"no-bitwise": "error",
"no-eq-null": "error",
"no-negated-condition": "error",
"no-nested-ternary": "error"
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/no-unused-vars": [
"off",
{
"args": "none"
}
]
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*-slice.ts", "*-slice.tsx"],
"rules": {
"fp/no-nil": "off",
"fp/no-unused-expression": "off",
"fp/no-let": "off",
"fp/no-mutating-methods": "off"
}
},
{
"files": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
],
"extends": [
"plugin:testing-library/react",
"plugin:jest-dom/recommended"
],
"rules": {
"testing-library/await-async-query": "error",
"testing-library/no-await-sync-query": "error",
"testing-library/no-debugging-utils": "warn",
"testing-library/no-dom-import": "off",
"jest-dom/prefer-checked": "error",
"jest-dom/prefer-enabled-disabled": "error",
"jest-dom/prefer-required": "error",
"jest-dom/prefer-to-have-attribute": "error",
"fp/no-loops": "off",
"fp/no-throw": "off"
}
},
{
"files": ["**/*/handlers.ts", "**/*/seed.ts"],
"rules": {
"fp-ts-strict/array-head": ["off"],
"fp-ts-strict/array-lookup": ["off"],
"fp/no-loops": "off",
"fp/no-throw": "off"
}
},
{
"files": ["**/*/generated.ts"],
"rules": {
"fp-ts-strict/array-head": ["off"],
"fp-ts-strict/array-lookup": ["off"],
"fp-ts-strict/record-lookup": ["off"],
"fp-ts-strict/option-over-null": ["off"],
"fp-ts-strict/option-over-undefined": ["off"],
"fp/no-arguments": "off",
"fp/no-class": "off",
"fp/no-delete": "off",
"fp/no-events": "off",
"fp/no-get-set": "off",
"fp/no-let": "off",
"fp/no-loops": "off",
"fp/no-mutating-assign": "off",
"fp/no-mutating-methods": "off",
"fp/no-mutation": "off",
"fp/no-nil": "off",
"fp/no-proxy": "off",
"fp/no-rest-parameters": "off",
"fp/no-this": "off",
"fp/no-throw": "off",
"fp/no-unused-expression": "off",
"fp/no-valueof-field": "off",
"no-var": "off"
}
},
{
"files": ["**/?(*.)+(spec|test).[jt]s?(x)"],
"rules": {
"fp/no-loops": "off",
"fp/no-throw": "off"
}
}
],
"extends": [
"plugin:storybook/recommended",
"plugin:prettier/recommended",
"plugin:fp-ts-strict/recommended"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment