Skip to content

Instantly share code, notes, and snippets.

@TClark1011
Last active February 20, 2022 13:05
Show Gist options
  • Select an option

  • Save TClark1011/c4378ed74183bf45e7f9ef137f786d10 to your computer and use it in GitHub Desktop.

Select an option

Save TClark1011/c4378ed74183bf45e7f9ef137f786d10 to your computer and use it in GitHub Desktop.
Bag of Holding V2 Eslint Setup
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:jest/recommended",
"plugin:sonarjs/recommended",
"plugin:promise/recommended",
"prettier",
],
plugins: [
"svelte3",
"@typescript-eslint",
"import",
"jest",
"promise",
"sonarjs",
"prefer-arrow",
],
ignorePatterns: ["*.cjs", "svelte.config.js", "cypress/**/*.js"],
overrides: [
{
files: ["*.svelte"],
processor: "svelte3/svelte3",
rules: {
"import/prefer-default-export": "off",
"import/no-mutable-exports": "off",
},
},
{
files: ["**/index.ts"],
rules: {
"no-restricted-exports": "off",
},
},
],
settings: {
"svelte3/typescript": () => require("typescript"),
},
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
project: ["./tsconfig.json", "./cypress/tsconfig.json"],
tsconfigRootDir: __dirname,
extraFileExtensions: [".svelte"],
},
env: {
browser: true,
es2017: true,
node: true,
},
rules: {
"prefer-arrow/prefer-arrow-functions": [
"error",
{
disallowPrototype: true,
singleReturnOnly: false,
classPropertiesAllowed: false,
},
],
},
};
  1. Set the version for eslint in dev dependencies too 7.3.0^ and run yarn
  2. Run npx install-peerdeps --dev eslint-config-airbnb-base
  3. Run yarn add --dev eslint-config-airbnb-typescript eslint-plugin-jest eslint-plugin-promise eslint-plugin-sonarjs eslint-plugin-prefer-arrow
  4. Copy in the contents of this Gist's eslint config file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment