1.0.6 • Published 3 years ago

@darwinhomes/eslint-config v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

@darwin-homes/eslint-config

Shareable ESLint config for Darwin Homes.

Usage

npm install --save-dev @darwinhomes/eslint-config

Then, add the following to your package.json:

{
  "scripts": {
    "lint": "eslint . --fix --ext .js,.jsx,.ts,.tsx --cache"
  },
  "eslintConfig": {
    "extends": "@darwinhomes",
    "settings": {
      "import/resolver": {
        "typescript": {
          "project": "./tsconfig.json"
        }
      }
    }
  }
}

If you're using a version of React that doesn't require import React when using JSX, you can add "plugin:react/jsx-runtime" to the "eslintConfig.extends".

You can also add "eslintIgnore": [] or pass --ignore-path .gitignore to exclude ignored files from formatting.

You'll also want to add .eslintcache to your .gitignore.

You may need to disable (or add) additional plugins or rules to work with existing code or alternative frameworks, depending on the project.

Once you've set up eslint (and Prettier, if desired, using our config), you can set up git hooks to run the linters pre-commit using lint-staged and husky (see their docs for the most up-to-date setup instructions):

npx mrm@2 lint-staged # You need to temporarily add `eslint` and `prettier` to your devDependencies or this will fail

Be sure to add tsc --noEmit (ideally aliased as npm run type-check) to your Husky config.

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago