Skip to content
/ linting Public

A collection of opinionated in-house linting rules.

License

Notifications You must be signed in to change notification settings

atmina/linting

Repository files navigation

@atmina/linting

A collection of optionated in-house linting rules.

ESLint configuration is provided in the eslint.config.js, aka. "Flat Config" format.

Quickstart

  1. Install
    yarn add -D @atmina/linting
    # or
    pnpm add -D @atmina/linting
  2. Run the CLI tool
    yarn linting
    # or
    pnpm linting
    This will set up the necessary dependencies and configurations for you.

IDE Integration

In VS Code, use these workspace settings:

{
  "eslint.experimental.useFlatConfig": true,
  "eslint.workingDirectories": [
    // In a monorepo, specify linted packages here
    "frontend"
  ],
  // Optional
  "editor.codeActionsOnSave": {
    "source.fixAll": true
  }
}

In WebStorm, go to Settings and enable ESLint (Select "Automatic ESLint Configuration"). If desired, enable "Run eslint --fix on Save".

Development

When working on linting, it may be useful to test its effects in a different project. To do so, link your local copy of linting in the other project's package.json (works with pnpm and yarn). This may require restarting your IDE once after setting up the link.

{
  "devDependencies": {
    "@atmina/linting": "link:local/path/to/linting"
  }
}