Skip to content

Instantly share code, notes, and snippets.

@KrzysztofZawisla
Created February 24, 2022 10:10
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 KrzysztofZawisla/b76ac56535060b56fd71c0cee5cb6bee to your computer and use it in GitHub Desktop.
Save KrzysztofZawisla/b76ac56535060b56fd71c0cee5cb6bee to your computer and use it in GitHub Desktop.
eslint
{
"env": {
"browser": true,
"es2021": true,
"jest/globals": true
},
"extends": [
"plugin:testing-library/react",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsdoc/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"prettier",
"plugin:sonarjs/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"testing-library",
"react",
"@typescript-eslint",
"eslint-plugin-tsdoc",
"jsdoc",
"jest",
"prettier",
"unicorn",
"sonarjs"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"jsx-a11y/aria-role": [
2,
{
"ignoreNonDOM": true
}
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "react",
"importNames": ["useState"],
"message": "Please import 'useState' from '@hookstate/core' instead."
}
]
}
],
"@typescript-eslint/no-inferrable-types": "off",
"no-invalid-this": "error",
"react/react-in-jsx-scope": "off",
"no-console": "warn",
"unicorn/better-regex": "error",
"unicorn/catch-error-name": "error",
"unicorn/consistent-function-scoping": "warn",
"unicorn/custom-error-definition": "error",
"unicorn/error-message": "error",
"unicorn/escape-case": "error",
"unicorn/explicit-length-check": "warn",
"unicorn/import-index": "error",
"unicorn/new-for-builtins": "error",
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-array-instanceof": "error",
"unicorn/no-console-spaces": "error",
"react-hooks/exhaustive-deps": "off",
"unicorn/no-fn-reference-in-iterator": "warn",
"unicorn/no-for-loop": "warn",
"unicorn/no-hex-escape": "error",
"no-nested-ternary": "off",
"unicorn/no-nested-ternary": "error",
"unicorn/no-new-buffer": "error",
"unicorn/no-object-as-default-parameter": "error",
"unicorn/no-process-exit": "warn",
"unicorn/no-unreadable-array-destructuring": "error",
"unicorn/no-unused-properties": "error",
"unicorn/no-useless-undefined": "error",
"unicorn/no-zero-fractions": "error",
"unicorn/number-literal-case": "error",
"unicorn/prefer-add-event-listener": "error",
"unicorn/prefer-array-find": "error",
"unicorn/prefer-event-key": "error",
"unicorn/prefer-flat-map": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-math-trunc": "error",
"unicorn/prefer-modern-dom-apis": "error",
"unicorn/prefer-negative-index": "error",
"unicorn/prefer-node-append": "error",
"unicorn/prefer-node-remove": "error",
"unicorn/prefer-optional-catch-binding": "error",
"unicorn/prefer-query-selector": "error",
"unicorn/prefer-replace-all": "off",
"unicorn/prefer-set-has": "error",
"unicorn/prefer-spread": "error",
"unicorn/prefer-starts-ends-with": "error",
"unicorn/prefer-text-content": "error",
"unicorn/prefer-trim-start-end": "error",
"unicorn/prefer-type-error": "error",
"unicorn/prevent-abbreviations": "error",
"unicorn/throw-new-error": "error"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment