0.6.0 • Published 11 months ago

@kachkaev/eslint-config-base v0.6.0

Weekly downloads
24
License
MIT
Repository
github
Last release
11 months ago

@kachkaev → eslint config (base)

Compatible with ESLint v7. Requires TypeScript to be present as a dependency.

See also @kachkaev/eslint-config-react.

Adding to project

  1. Install the package:

    npm install -D @kachkaev/eslint-config-base
    ## or
    yarn add -D @kachkaev/eslint-config-base
  2. Create .eslintrc.js with the following contents:

    module.exports = {
      extends: ["@kachkaev/eslint-config-base"],
    };

    If you want extra typechecking (tsconfig.json needs to exist in repo dir):

    module.exports = {
      extends: [
        "@kachkaev/eslint-config-base",
        "@kachkaev/eslint-config-base/extra-type-checking",
      ],
    };
  3. Create .eslintignore. For example,

    #####################
    ## Specific to ESLint
    #####################
    
    ## Ignore all files (but still allow sub-folder scanning)
    *
    !*/
    
    ## Allow certain file types
    !*.cjs
    !*.cts
    !*.js
    !*.json
    !*.mjs
    !*.mts
    !*.ts
    
    ########################
    ## Same as in .gitignore
    ########################
    
    # (paste lines from .gitignore here)
  4. Optionally, configure package scripts and a pre-commit hook to make sure that all project files are always formatted. See example in njtpackage.json.