Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

[DEPRECATED] JavaScript Code Standards for Globex Designs - ESLint Shareable Config

License

Notifications You must be signed in to change notification settings

GlobexDesignsInc/eslint-config-globex

Repository files navigation

Caution

This package has been deprecated. The Globex Designs team has moved to https://biomejs.dev/ and this config is no longer going to be maintained.

eslint-config-globex

eslint-config-globex

The Javascript code standards used at Globex Designs, Inc.

NPM Status NPM Download Stats NPM Download Stats


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 own eslint-globex bin tool so that you don't need to install eslint as a peerDependency. eslint-config-globex tracks and manages eslint 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 eslint/eslint#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: true,
    	tsconfigRootDir: __dirname,
	}
}