@inrupt/eslint-config-lib

3.2.1 • Public • Published

eslint-config-inrupt-lib

Eslint and prettier configs

Installation

  1. npm install --save-dev @inrupt/eslint-config-lib @rushstack/eslint-patch

Setup (Quick start)

Create a .eslintrc.js in the the root of your project with the following contents:

require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
  extends: ["@inrupt/eslint-config-lib"],
  parserOptions: {
    project: "./tsconfig.eslint.json",
  },
  rules: {},
};

The file tsconfig.eslint.json is your typescript configuration with the e2e tests, unit tests and examples included, e.g.,

{
  "extends": "./tsconfig.json",
  "include": ["src/**/*.ts", "e2e/**/*.ts", "examples/**/*.ts", "*.md"],
  "exclude": ["**/node_modules", "**/dist/**"]
}

Migrating to this configuration:

  1. Add extends: ['@inrupt/eslint-config-lib'] to your .eslintrc.js file.
  2. Add the following line to the top of the .eslintrc.js file:
require("@rushstack/eslint-patch/modern-module-resolution");

Rules

Exhaustive documentation forthcoming. For now, the general principles are:

  • Load inrupt-base, which loads recommended configs for common libraries: eslint, jest, typescript, and prettier
  • Do very little else- as few custom rules or overrides as possible.
  • Some rules are updated to work with nextjs.

Readme

Keywords

Package Sidebar

Install

npm i @inrupt/eslint-config-lib

Weekly Downloads

847

Version

3.2.1

License

MIT

Unpacked Size

6.56 kB

Total Files

4

Last publish

Collaborators

  • astrid.vazquez
  • timbl
  • rubenverborgh
  • nseydoux
  • pmcb55
  • inrupt_ci