aboutsummaryrefslogtreecommitdiff
path: root/packages/eslint-config/react-internal.js
blob: ce97908ad13f2ab62b5acfec73f7acedf8baa41f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const { resolve } = require("node:path");

const project = resolve(process.cwd(), "tsconfig.json");

/*
 * This is a custom ESLint configuration for use with
 * internal (bundled by their consumer) libraries
 * that utilize React.
 */

/** @type {import("eslint").Linter.Config} */
module.exports = {
	extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
	plugins: ["only-warn"],
	globals: {
		React: true,
		JSX: true,
	},
	env: {
		browser: true,
	},
	settings: {
		"import/resolver": {
			typescript: {
				project,
			},
		},
	},
	ignorePatterns: [
		// Ignore dotfiles
		".*.js",
		"node_modules/",
		"dist/",
	],
	overrides: [
		// Force ESLint to detect .tsx files
		{ files: ["*.js?(x)", "*.ts?(x)"] },
	],
};