eslint-plugin-oev

2.0.3 • Public • Published

eslint-plugin-oev

Common lint and formatting rules for OEV Berlin projects.

Installation

yarn add -D eslint eslint-plugin-oev

Use

🚧 Note: This plugin only supports Eslint 9 and the flat configuration format.

Use oev/* in your eslint.config.mjs file:

import { nextConfig } from 'eslint-plugin-oev';

export default [ 
  ...nextConfig,
  {
    ignores: [
      // ignore files you don't want to lint
    ],
  }
];

Available Recommended Eslint Configurations

  • import { nextConfig } from 'eslint-plugin-oev: Use for Next.js projects
  • import { reactConfig } from 'eslint-plugin-oev: Use for React projects
  • import { nodeConfig } from 'eslint-plugin-oev: Use for Node projects

Overridden rules

Check the overrides documentation for a list of rules we override and the rationale behind it.

About prettier

In Version 1.0.0 we removed the prettier dependency from this package. We replaced prettier with stylistic as we want to use one tool for formatting and linting.

In some IDEs, like VSCode, prettier is configured as the default formatter. To avoid conflicts, you need to disable prettier in your IDE. Take the following example settings.json for VSCode:

"prettier.enable": false,
"editor.formatOnSave": false,

"editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
},

"eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "vue",
    "html",
    "markdown",
    "json",
    "jsonc",
    "yaml",
    "toml",
    "xml",
    "gql",
    "graphql",
    "astro",
    "svelte",
    "css",
    "less",
    "scss",
    "pcss",
    "postcss"
 ],

Tests

Execute the linting tests with:

yarn test

Note that linting errors are expected in the test files.

Another way of debugging the linting rules is to run the following command:

yarn inspect

Readme

Keywords

Package Sidebar

Install

npm i eslint-plugin-oev

Weekly Downloads

90

Version

2.0.3

License

none

Unpacked Size

8.67 kB

Total Files

8

Last publish

Collaborators

  • pinussilvestrus