1.1.12 • Published 6 months ago

eslint-config-gmana v1.1.12

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

eslint-config-gmana

Goals

  1. Find errors that are detectable with static analysis.
  2. Make reading code easier by providing consistent code style.
  3. Make writing code faster by leveraging auto fix wherever possible.

Getting started

  1. pnpm add eslint eslint-config-gmana prettier --dev
  2. Setup your project config in eslint.config.mjs:
import { getPresets } from 'eslint-config-gmana';

export default [
  ...(await getPresets(
    // Base config
    'typescript', // or 'javascript'

    // Optional extensions
    'react',
    'cssModules',
    'tailwind',
    'jest',
    'cypress',
    'vitest',
  )),

  {
    // Your custom config
  },
];
  1. If you require globals, like browser APIs on window, you can add them to your config:
// eslint.config.mjs
import globals from 'globals';

export default [
  // ...
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.node,
      },
    },
  },
];
  1. To set up Prettier, add to your package.json:
"prettier": "eslint-config-gmana/.prettierrc.json"
  1. If you use TypeScript, add to your tsconfig.json:
"extends": "eslint-config-gmana/tsconfig.json"

Happy linting!

Further configuration

CI integration

To validate your code in a CI pipeline, add the following to your package.json:

"scripts": {
  "lint": "eslint src && prettier src --check"
}

VSCode integration

The following two extensions are recommended:

  1. dbaeumer.vscode-eslint
  2. esbenp.prettier-vscode

To auto-fix errors from ESLint as well as Prettier on save, you can use the following configuration:

// settings.json (VSCode)
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "always"
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}
1.1.12

6 months ago

1.1.11

6 months ago

1.1.9

6 months ago

1.1.8

7 months ago

1.1.10

6 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

9 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.27

10 months ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago