2022-08-30 16:53:35 +03:00
|
|
|
/* eslint-env node */
|
|
|
|
module.exports = {
|
|
|
|
root: true,
|
|
|
|
extends: [
|
2023-07-27 10:49:51 +03:00
|
|
|
'plugin:ghost/ts',
|
|
|
|
'plugin:react/recommended'
|
2022-08-30 16:53:35 +03:00
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
'ghost',
|
|
|
|
'tailwindcss'
|
|
|
|
],
|
2023-07-27 10:49:51 +03:00
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: 'detect'
|
|
|
|
}
|
|
|
|
},
|
2022-08-30 16:53:35 +03:00
|
|
|
rules: {
|
2023-06-22 11:39:39 +03:00
|
|
|
// sort multiple import lines into alphabetical groups
|
|
|
|
'ghost/sort-imports-es6-autofix/sort-imports-es6': ['error', {
|
|
|
|
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple']
|
|
|
|
}],
|
|
|
|
|
2023-07-27 10:49:51 +03:00
|
|
|
// TODO: fix + remove this
|
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
|
|
|
2023-06-22 11:39:39 +03:00
|
|
|
// 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: 'tailwind.config.cjs'}],
|
|
|
|
'tailwindcss/enforces-negative-arbitrary-values': ['warn', {config: 'tailwind.config.cjs'}],
|
|
|
|
'tailwindcss/enforces-shorthand': ['warn', {config: 'tailwind.config.cjs'}],
|
|
|
|
'tailwindcss/migration-from-tailwind-2': ['warn', {config: 'tailwind.config.cjs'}],
|
2022-08-30 16:53:35 +03:00
|
|
|
'tailwindcss/no-arbitrary-value': 'off',
|
|
|
|
'tailwindcss/no-custom-classname': 'off',
|
2023-06-27 15:51:37 +03:00
|
|
|
'tailwindcss/no-contradicting-classname': ['error', {config: 'tailwind.config.cjs'}],
|
|
|
|
|
|
|
|
// This rule doesn't work correctly with TypeScript, and TypeScript has its own better version
|
|
|
|
'no-undef': 'off'
|
2022-08-30 16:53:35 +03:00
|
|
|
}
|
|
|
|
};
|