open-index/open-npm huggingface dataset:
npm package: @paulaschoice/eslint
Description: Collection of internal eslint configurations.
Latest version: 0.1.1

# `@paulaschoice/eslint-config`

Collection of internal eslint configurations.

# Example Usage

Only use this for reference, do not copy line for line. Refer to [eslint docs](https://eslint.org/docs/latest/use/configure/configuration-files) for more information.

React Project

```js
import globals from 'globals';
import createBaseConfig from '@paulaschoice/eslint/base.mjs';
import reactConfig from '@paulaschoice/eslint/react.mjs';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import path from 'path';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const dir = path.resolve(__dirname);
const baseConfig = createBaseConfig(dir);

/** @type {import('typescript-eslint').Config} */
export default [
	...baseConfig,
	...reactConfig,
	{
		languageOptions: {
			globals: {
				...globals.browser,
			},
		},
		// Duplicate plugin added here to allow exhaustive-deps to be added.
		plugins: { 'react-hooks': reactHooksPlugin },
		rules: {
			'react-hooks/exhaustive-deps': [
				'error',
				{
					additionalHooks:
						'(usePageChange|useCustomerChange|useBagChange|useScrolledInToView|useListener|useResizeObserver|useDocumentEventListener|useEmailSignUp)',
				},
			],
		},
	},
];
```

TS project

```js
import createBaseConfig from '@paulaschoice/eslint/base.mjs';
import path from 'node:path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const baseConfig = createBaseConfig(__dirname);

/** @type {import('typescript-eslint').Config} */
export default [
	...baseConfig,
	{
		languageOptions: {
			globals: {
				require: 'readonly',
				module: 'readonly',
				exports: 'readonly',
			},
		},
		rules: {
			'@typescript-eslint/no-require-imports': 'off',
		},
	},
	{ ignores: ['data/**/*'] },
];
```