1.1.1 • Published 9 months ago
@davincihealthcare/eslint-plugin-davinci v1.1.1
Install the
@davincihealthcare/eslint-plugin-davincipackage as a dev dependencyIf you're using
eslint >= 9.0.0, you'll also need to install the following packages as dev dependencies:@eslint/js@eslint/eslintrc
Extend the plugin in the eslint configuration file
.eslintrc.jsmodule.exports = { extends: [ 'plugin:@davincihealthcare/davinci/recommended', ], }eslint.config.jsimport 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")];If you're using
Turbomonorepo:- Install
eslint-config-turboas a dev dependency Extend the
eslint-config-turboplugin in your configuration:.eslintrc.js( module.exports = { extends: [ 'plugin:@davincihealthcare/davinci/recommended', 'eslint-config-turbo' ], } );eslint.config.jsimport 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")];
- Install
In your
package.jsonfile, 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 ." ... } ... }