Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install npm dependencies
run: |
cd with-i18n-translate
npm install
npm install --legacy-peer-deps

- name: Prod Build for GitHub demo website
run: |
Expand Down
66 changes: 24 additions & 42 deletions single-locale-without-i18n/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,74 +1,56 @@
import eslint from '@eslint/js';
import eslint from 'eslint';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import n from 'eslint-plugin-n';
import tseslint from 'typescript-eslint';
import globals from 'globals';

export default tseslint.config(
export default [
{
ignores: [
'**/*.{js,mjs}',
'**/*.d.ts',
'**/dist',
'**/__tests__/*',
],
ignores: ['**/*.{js,mjs}','**/*.d.ts','**/dist','**/__tests__/*'],
},
{
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
],
plugins: {
'react-hooks': reactHooks,
react: reactPlugin,
n
},
files: ['**/*.{ts,tsx}'],
languageOptions: {
globals: {
...globals.es2021,
...globals.browser,
},
parser: tseslint.parser,
parser: tsParser,
parserOptions: {
project: ['./tsconfig.json', './test/tsconfig.spec.json', './test/cypress/tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
}
project: ['./tsconfig.json','./test/tsconfig.spec.json','./test/cypress/tsconfig.json'],
tsconfigRootDir: new URL('.', import.meta.url).pathname,
},
globals: { ...globals.es2021, ...globals.browser },
},
plugins: { react: reactPlugin, 'react-hooks': reactHooks, n, '@typescript-eslint': tsPlugin },
settings: {
node: {
tryExtensions: ['.ts'],
resolvePaths: ['node_modules/@types']
}
node: { tryExtensions: ['.ts'], resolvePaths: ['node_modules/@types'] }
},
rules: {
// keep your rules; update names if plugin authors renamed them
...reactHooks.configs.recommended.rules,
'react-hooks/refs': 'off',
'react-hooks/set-state-in-effect': 'off',
'react-hooks/exhaustive-deps': 'off',
'react-hooks/immutability': 'off',
'react-hooks/immutability': 'off',
'react-hooks/purity': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-object-type': [
'error',
{ allowInterfaces: 'with-single-extends' }, // maybe we should turn this on in a new PR
],
'@typescript-eslint/no-empty-object-type': ['error',{ allowInterfaces: 'with-single-extends' }],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'destructuredArrayIgnorePattern': '^_', caughtErrors: 'none' }],
'@typescript-eslint/no-unused-vars': ['error',{ argsIgnorePattern:'^_', destructuredArrayIgnorePattern:'^_', caughtErrors:'none' }],
'@typescript-eslint/no-use-before-define': 'off',
'object-shorthand': 'error',
'no-async-promise-executor': 'off',
'no-case-declarations': 'off',
'no-prototype-builtins': 'off',
'no-extra-boolean-cast': 'off',
'react-hooks/immutability': 'off',
'react-hooks/purity': 'off',
'react-hooks/exhaustive-deps': 'off',
'no-use-before-define': 'off',
'semi': 'off',
}
});
}
];
Loading
Loading