4.0.0 • Published 9 months ago

@julr/tooling-configs v4.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Features

  • Designed to work with Prettier, Vue, Typescript, JSX, Node, AdonisJS out of the box
  • Lint json files ( TSConfig, package.json )
  • Super easy to use ( one line of code )
  • ESLint flat config
  • Use .gitignore as ignore file

Usage

!IMPORTANT

  • This config is using the new ESLint Flat config
  • New/updated rules will not be considered as breaking changes. Only API changes will be considered as breaking changes.

CLI installation

Just run this command in your project root directory:

pnpm dlx @julr/tooling-configs@latest

Manual install

pnpm add -D eslint prettier @julr/tooling-configs

Eslint

// .eslintrc
import { julr } from '@julr/tooling-configs/eslint'

export default await julr({
  // Julr options configurations
})

You don't need .eslintignore as it has been provided by the preset.

Inspector

Want to quickly inspect what rules are being used ?

Run this command from your project root directory:

npx @eslint/config-inspector

Config Composer

julr() returns a FlatConfigComposer object from eslint-flat-config-utils where you can chain the methods to compose the config even more flexibly.

// eslint.config.js
import julr from '@julr/tooling-configs/eslint'

export default julr()
  .prepend(
    // some configs before the main config
  )
  // rename plugin prefixes
  .renamePlugins({
    'old-prefix': 'new-prefix',
    // ...
  })
// ...

Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

Prettier

{
  "prettier": "@julr/tooling-configs/prettier"
}

Tsconfig

Node ( ESM ) :

{
  "extends": "@julr/tooling-configs/tsconfigs/tsconfig.node",
  "compilerOptions": {
    "rootDir": "./",
    "outDir": "./build"
  }
}

Vue :

{
  "extends": "@julr/tooling-configs/tsconfigs/tsconfig.vue",
  "compilerOptions": {
    "rootDir": "./",
    "outDir": "./build"
  }
}