Files
DuckQ1u 93d1b7c3d3
Copilot Setup Steps / copilot-setup-steps (push) Has been cancelled
first commit
2026-04-22 19:51:20 +07:00

60 lines
2.0 KiB
JavaScript

/* eslint-env node */
const tailwindConfig = `${__dirname}/tailwind.config.cjs`;
module.exports = {
root: true,
extends: [
'plugin:ghost/ts',
'plugin:react/recommended',
'plugin:i18next/recommended'
],
plugins: [
'ghost',
'tailwindcss',
'i18next'
],
settings: {
react: {
version: 'detect'
}
},
rules: {
// Sort multiple import lines into alphabetical groups
'ghost/sort-imports-es6-autofix/sort-imports-es6': ['error', {
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple']
}],
// Enforce kebab-case (lowercase with hyphens) for all filenames
'ghost/filenames/match-regex': ['error', '^[a-z0-9.-]+$', false],
// TODO: fix + remove this
'@typescript-eslint/no-explicit-any': 'warn',
// Suppress errors for missing 'import React' in JSX files, as we don't need it
'react/react-in-jsx-scope': 'off',
// Ignore prop-types for now
'react/prop-types': 'off',
// custom react rules
'react/jsx-sort-props': ['error', {
reservedFirst: true,
callbacksLast: true,
shorthandLast: true,
locale: 'en'
}],
'react/button-has-type': 'error',
'react/no-array-index-key': 'error',
'tailwindcss/classnames-order': ['error', {config: tailwindConfig}],
'tailwindcss/enforces-negative-arbitrary-values': ['warn', {config: tailwindConfig}],
'tailwindcss/enforces-shorthand': ['warn', {config: tailwindConfig}],
'tailwindcss/migration-from-tailwind-2': ['warn', {config: tailwindConfig}],
'tailwindcss/no-arbitrary-value': 'off',
'tailwindcss/no-custom-classname': 'off',
'tailwindcss/no-contradicting-classname': ['error', {config: tailwindConfig}],
// This rule doesn't work correctly with TypeScript, and TypeScript has its own better version
'no-undef': 'off'
}
};