npm.io
9.0.35 • Published 2 years ago

@alergeek-ventures/eslint-config

Licence
MIT
Version
9.0.35
Deps
21
Size
42 kB
Vulns
1
Weekly
0

AV's ESLint configuration

  • our way of ensuring code consistency
  • no styling rules - use with prettier
  • available flavors :
    • vanilla (Javascript + imports)
    • typescript (uses @typescript-eslint suite)
    • react (react, JSX, hooks)
    • react-native (react, react-native, a11y)
    • tests (integration / unit tests via @testing-library and jest)
    • cypress (e2e tests)
    • cspell-eslint (spell checking)

how to use

# .eslintrc.js
module.exports = {
  env: {
    node: true,
    commonjs: true,
    jest: true,
  },
  extends: ["./vanilla.js", "./typescript.js", "./react.js", "./tests.js"],
  parser: "@typescript-eslint/parser",
  root: true,
  parserOptions: {
    /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment */
    tsconfigRootDir: __dirname,
    project: ["./tsconfig.json"],
  },

  settings: {
    react: {
      version: "detect",
    },
  },
};

Cspell

Create .cspell.json file if you want to use spell checking

{
  "import": ["@alergeek-ventures/eslint-config/.cspell.json"],
  "dictionaries": ["customWords"],
  "dictionaryDefinitions": [
    { "name": "customWords", "path": "path/to/your/custom/dictionary" }
  ]
}