Install
# With npm
npm install -D eslint-config-globex
# or
# With yarn
yarn add -D eslint-config-globex
# or
# With pnpm
pnpm add -D eslint-config-globex
Note for pnpm users
If you are using pnpm, it's recommended that you add the following to your .npmrc
file to ensure code editors like VS Code can find the correct ESLint executuable:
public-hoist-pattern[]=*eslint*
Usage
Note
eslint-config-globex
comes with its owneslint-globex
bin tool so that you don't need to installeslint
as a peerDependency.eslint-config-globex
tracks and manageseslint
versions so you don't have to.
Add the config to your .eslintrc.js
file:
module.exports = {
"extends": ["eslint-config-globex"]
}
Enable via package.json
scripts with the custom eslint-globex
bin:
{
"scripts": {
"eslint": "eslint-globex ."
}
}
Extensions
The following optional extensions are available
@eslint-config-globex/flowtype
: Additional rules for Flow static typing (DEPRECATED)@eslint-config-globex/jasmine
: Additional rules for Jasmine@eslint-config-globex/jest
: Additional rules for Jest@eslint-config-globex/next
: Additional rules for Next.js@eslint-config-globex/node
: Additional rules for Node.js@eslint-config-globex/react
: Additional rules for React@eslint-config-globex/typescript
: Additional rules for TypeScript@eslint-config-globex/vitest
: Additional rules for Vitest
You can add an extension to your .eslintrc
file like this:
module.exports = {
"extends": [
"eslint-config-globex",
"./node_modules/@eslint-config-globex/jest",
"./node_modules/@eslint-config-globex/react"
]
}
NOTE Unfortunately the
./node_modules/
prefix is needed because ESLint doesn't support scoped package names in extend. See https://github.com/eslint/eslint/issues/9868 for more info. This problem will go away once we use the new ESlint config syntax.
Usage with Prettier
Unfortunately, Prettier has some opinions which are incompatible with the rules in this module and therefore cannot be used with eslint-config-globex
.
Usage with TypeScript
To use this config with TypeScript, enable the @eslint-config-globex/typescript
rule set and make sure to set the parserOptions.project
config setting in your project's eslint.config.js
file:
module.exports = {
extends: [
"eslint-config-globex",
"./node_modules/@eslint-config-globex/typescript",
],
parserOptions: {
project: './tsconfig.json'
}
}