Skip to content

Commit

Permalink
new config
Browse files Browse the repository at this point in the history
  • Loading branch information
gerbenmeyer committed Sep 12, 2024
1 parent b14ed8d commit 44a9386
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 17 deletions.
11 changes: 0 additions & 11 deletions .eslintrc.js

This file was deleted.

54 changes: 54 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import prettier from 'eslint-plugin-prettier';
import babelParser from '@babel/eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import { fixupPluginRules, fixupConfigRules } from '@eslint/compat';
import importPlugin from 'eslint-plugin-import';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...fixupConfigRules(compat.extends('airbnb', 'airbnb/hooks')),
...compat.extends('prettier', 'plugin:prettier/recommended'),
{
plugins: {
prettier,
import: fixupPluginRules(importPlugin),
},

languageOptions: {
globals: {
fetch: 'readonly',
JSX: true,
},

parser: babelParser,
},

settings: {
'import/resolver': {
node: {},
exports: {},
},
},

rules: {
'react/jsx-filename-extension': 'off',
'no-underscore-dangle': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-fragments': 'off',
'react/jsx-filename-extension': 'off',
// 'import/extensions': ['error', 'ignorePackages'],
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
},
},
];
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"test": "jest --verbose",
"test:watch": "npm test -- --watch",
"lint": "eslint src/**/*.jsx src/**/*.js __test__/**/*.js",
"lint": "eslint src/**/*.js __test__/**/*.js",
"lint:fix": "npm run lint -- --fix",
"dtslint": "dtslint types",
"build": "rimraf cjs es && npx browserslist --update-db && NODE_ENV=cjs babel src -d cjs && NODE_ENV=es babel src -d es",
Expand Down Expand Up @@ -64,6 +64,9 @@
"dayjs": "1.11.13",
"dtslint": "4.2.1",
"eslint": "9.10.0",
"@eslint/compat": "1.1.1",
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.9.1",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.30.0",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { forceComponentsUpdate } from './components/Base';
export { default as Translate } from './components/Translate';
export { default as Localize } from './components/Localize';
export { default as I18n } from './components/I18n';
export { forceComponentsUpdate } from './components/Base.js';
export { default as Translate } from './components/Translate.js';
export { default as Localize } from './components/Localize.js';
export { default as I18n } from './components/I18n.js';
export { getLocale, setLocale, setLocaleGetter, getTranslations, setTranslations, setTranslationsGetter, setHandleMissingTranslation, setHandleFailedLocalization } from './lib/settings';
export { default as translate } from './lib/translate';
export { default as t } from './lib/translate';
Expand Down
12 changes: 11 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,11 @@
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae"
integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==

"@eslint/[email protected]":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@eslint/compat/-/compat-1.1.1.tgz#5736523f5105c94dfae5f35e31debc38443722cd"
integrity sha512-lpHyRyplhGPL5mGEh6M9O5nnKk0Gz4bFI+Zu6tKlPpDUN7XshWvH9C/px4UVm87IAANE0W81CEsNGbS1KlzXpA==

"@eslint/config-array@^0.18.0":
version "0.18.0"
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.18.0.tgz#37d8fe656e0d5e3dbaea7758ea56540867fd074d"
Expand All @@ -1122,7 +1127,7 @@
debug "^4.3.1"
minimatch "^3.1.2"

"@eslint/eslintrc@^3.1.0":
"@eslint/eslintrc@3.1.0", "@eslint/eslintrc@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6"
integrity sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==
Expand All @@ -1142,6 +1147,11 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.10.0.tgz#eaa3cb0baec497970bb29e43a153d0d5650143c6"
integrity sha512-fuXtbiP5GWIn8Fz+LWoOMVf/Jxm+aajZYkhi6CuEm4SxymFM+eUWzbO9qXT+L0iCkL5+KGYMCSGxo686H19S1g==

"@eslint/[email protected]":
version "9.9.1"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.9.1.tgz#4a97e85e982099d6c7ee8410aacb55adaa576f06"
integrity sha512-xIDQRsfg5hNBqHz04H1R3scSVwmI+KUbqjsQKHKQ1DAUSaUjYPReZZmS/5PNiKu1fUvzDd6H7DEDKACSEhu+TQ==

"@eslint/object-schema@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843"
Expand Down

0 comments on commit 44a9386

Please sign in to comment.