1.1.1 • Published 8 months ago

@davincihealthcare/eslint-plugin-davinci v1.1.1

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago
  1. Install the @davincihealthcare/eslint-plugin-davinci package as a dev dependency

    If you're using eslint >= 9.0.0, you'll also need to install the following packages as dev dependencies:

    • @eslint/js
    • @eslint/eslintrc
  2. Extend the plugin in the eslint configuration file

    .eslintrc.js

      module.exports = {
        extends: [
          'plugin:@davincihealthcare/davinci/recommended',
        ],
      }

    eslint.config.js

    import path from "node:path";
    import { fileURLToPath } from "node:url";
    import js from "@eslint/js";
    import { FlatCompat } from "@eslint/eslintrc";
    
    const __filename = fileURLToPath(import.meta.url);
    const __dirname = path.dirname(__filename);
    const compat = new FlatCompat({
        baseDirectory: __dirname,
        recommendedConfig: js.configs.recommended,
        allConfig: js.configs.all
    });
    
    export default [{
        ignores: ["dist", "**/tsconfig.json"],
    }, ...compat.extends("plugin:@davincihealthcare/davinci/recommended")];
  3. If you're using Turbo monorepo:

    • Install eslint-config-turbo as a dev dependency
    • Extend the eslint-config-turbo plugin in your configuration:

      .eslintrc.js

      (
        module.exports = {
          extends: [
            'plugin:@davincihealthcare/davinci/recommended',
            'eslint-config-turbo'
          ],
        }
      );

      eslint.config.js

      import path from "node:path";
      import { fileURLToPath } from "node:url";
      import js from "@eslint/js";
      import { FlatCompat } from "@eslint/eslintrc";
      
      const __filename = fileURLToPath(import.meta.url);
      const __dirname = path.dirname(__filename);
      const compat = new FlatCompat({
          baseDirectory: __dirname,
          recommendedConfig: js.configs.recommended,
          allConfig: js.configs.all
      });
      
      export default [{
          ignores: ["dist", "**/tsconfig.json"],
      }, ...compat.extends("plugin:@davincihealthcare/davinci/recommended", "eslint-config-turbo")];
  4. In your package.json file, you should add scripts to perform linting checks and/or automatically fix linting errors where possible

    • eslint < 9.0.0

    package.json

    {
        ...
        "scripts": {
            ...
            "eslint-check": "eslint -c .eslintrc.js --ext \".js,.ts\" ."
            "eslint-fix": "eslint --fix -c .eslintrc.js --ext \".js,.ts\" ."
            ...
        }
        ...
    }
    • eslint >= 9.0.0

    package.json

    {
        ...
        "scripts": {
            ...
            "eslint-check": "eslint ."
            "eslint-fix": "eslint --fix ."
            ...
        }
        ...
    }
1.1.1

8 months ago

1.1.0

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago