ppanel-web/packages/eslint-config/react-internal.js
2024-11-14 01:22:43 +07:00

40 lines
763 B
JavaScript

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', '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)'] },
],
};