5.4.1 • Published 1 month ago

@josundt/eslint-config v5.4.1

Weekly downloads
6
License
ISC
Repository
github
Last release
1 month ago

@josundt/eslint-config

ESLint ruleset including required ESLint plugins for jorundt TypeScript projects

Usage

  1. Make sure you have installed and configured @josundt/prettier-config first

  2. Install this package

    npm install @josundt/eslint-config
  3. Create an .eslintrc file in the root directory of your project with the following content:

    {
        "extends": ["@josundt"]
    }

    ["@josundt"] is the default configuration for typescript web projects with jasmine unit tests

    Other configurations:

    • ["@josundt/eslint-config/typescript-web"] (same as default; only without jasmine linting support).

    • ["@josundt/eslint-config/typescript-node-jasmine"] (same as default; but without browser environment).

    • ["@josundt/eslint-config/typescript-node"] (same as default; but without browser environment and jasmine linting support) .

  1. Add lint:ts script to your project's package.json file:

    {
        // ...
        "scripts": {
            // ...
            "lint:ts": "eslint ./src --format visualstudio --ext .ts,.tsx"
            // ...
        }
        // ...
    }
  2. Test the script:

    npm run lint:ts
  3. Live Code Analysis in Visual Studio Code:

    • Add a .eslintignore file in the root directory of your project with the following content:
      # Ignore js files; only analyze typescript files:
      **/*.js
    • Install extension for VSCode: ESLint (dbaeumer.vscode-eslint)