52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import js from '@eslint/js';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
import globals from 'globals';
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ['**/dist/**', 'apps/api/**'] },
|
|
{
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: { ecmaVersion: 'latest' },
|
|
},
|
|
{
|
|
files: ['apps/web/**/*.{ts,tsx}'],
|
|
languageOptions: { globals: globals.browser },
|
|
extends: [reactHooks.configs.flat.recommended, reactRefresh.configs.vite],
|
|
rules: {
|
|
'react-refresh/only-export-components': [
|
|
'warn',
|
|
{ allowConstantExport: true, allowExportNames: ['loader'] },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['scripts/**/*.ts', '*.ts'],
|
|
languageOptions: { globals: globals.node },
|
|
},
|
|
{
|
|
files: ['packages/combat-core/src/**/*.ts'],
|
|
ignores: ['**/*.test.*', '**/*.spec.*'],
|
|
rules: {
|
|
'no-restricted-properties': [
|
|
'error',
|
|
{ object: 'Math', property: 'random', message: 'Use the battle RNG.' },
|
|
{
|
|
object: 'Date',
|
|
property: 'now',
|
|
message: 'Pass time from the host.',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.test.{ts,tsx}', '**/__mocks__/**'],
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
},
|
|
},
|
|
);
|