2.0.0 • Published 10 months ago

@denovo/eslint-config v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

👾 @denovo/eslint-config

A ESLint configuration for projects following the Denovo coding guidelines.

Installation

npm install --save-dev @denovo/eslint-config eslint @eslint/js typescript-eslint
or
yarn add -D @denovo/eslint-config eslint @eslint/js typescript-eslint

If you want to use the React configuration, you also need to install the following packages:

npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh
or
yarn add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh

ESLint Compatibility

Version 2.0.0 and newer will only support the new flat config format introduced in ESLint 9.0.0. If you are using an older version of ESLint, you will need to stick with version 1.x.x of this config.

ESLint versionDenovo Config version
< 9< 2.0.0
>= 9.0.0>= 2.0.0

Usage

If you haven't already, create an eslint.config.mjs file and extend the configuration with this package. This package uses typescript-eslint language features, so you must specify language options in the eslint configuration. Here is an example of a basic configuration. Please adapt it to your needs.

import globals from "globals";
import tseslint from "typescript-eslint";
import denovoEslintBaseConfig from "@denovo/eslint-config";
import denovoEslintReactConfig from "@denovo/eslint-config/react.js";

export default tseslint.config({
  ignores: ["dist", "src/api/ima-api/graphql/generated.tsx"],
  extends: [denovoEslintBaseConfig, denovoEslintReactConfig],
  files: ["src/**/*.{ts,tsx}"],
  languageOptions: {
    ecmaVersion: 2020,
    globals: globals.browser,
    parserOptions: {
      projectService: true,
      tsconfigRootDir: import.meta.dirname,
    },
  },
});

How to contribute

  • Change the index.js file in arrangement with the Denovo QA team.
  • Run npm run publish and follow the instructions.
2.0.0

10 months ago

1.0.1

2 years ago

1.0.0

2 years ago