@gitlab/eslint-plugin

GitLab package for our custom eslint rules
1,392,946
Install
npm install @gitlab/eslint-plugin
Latest Version:24.4.2
License:MIT
Last Updated:Oct 12, 2026
Links: GitLab  ·  npm
Maintainer: rob.hunt-gitlab

pipeline status code style: prettier

@gitlab/eslint-plugin

This package contains eslint rules developed for GitLab and shared eslint config to be used in all javascript projects across GitLab.

It encapsulates our coding standards and is based primarily upon eslint-config-airbnb-base and eslint-plugin-vue with the expectation that code formatting is handled separately by prettier.

Generally we should use upstream rules that are defined in eslint or eslint-plugin-vue. If one of these packages lacks a rule, we can create it here in order to enforce it, and try to get it upstream later.

Documentation

Requirements

  • ESLint, configured with flat config (eslint.config.js)
  • Node.js

Every config this package exports is a flat config array:

const gitlab = require('@gitlab/eslint-plugin');

module.exports = [...gitlab.configs.default];

The eslintrc configs (extends: ['plugin:@gitlab/default']) were removed in this major release. See Installation and Usage for the migration.

Using the typescript config additionally requires @typescript-eslint/parser, @typescript-eslint/eslint-plugin and typescript in your own project. They are optional peer dependencies, so your project controls their versions — the overrides workaround this README used to document is no longer needed.

Contribution guidelines

Please refer to gitlab's CONTRIBUTING.md for details on our guidelines.

Related Packages

Version History

Version Released License
24.4.2 MIT
24.4.1 MIT
24.4.0 MIT
24.3.0 MIT
24.2.0 MIT