Skip to content

Commit

Permalink
feat: fix compat
Browse files Browse the repository at this point in the history
  • Loading branch information
danieloprado committed Jun 3, 2024
1 parent 3180131 commit 081d5f0
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
3 changes: 2 additions & 1 deletion configs/react.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { fixupPluginRules } = require('@eslint/compat');
const pluginReact = require('eslint-plugin-react');
const pluginReactHooks = require('eslint-plugin-react-hooks');

Expand All @@ -9,7 +10,7 @@ module.exports = {
},
plugins: {
'react': pluginReact,
'react-hooks': pluginReactHooks
'react-hooks': fixupPluginRules(pluginReactHooks)
},
rules: {
...pluginReact.configs.recommended.rules,
Expand Down
1 change: 0 additions & 1 deletion configs/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module.exports = [
],
'@typescript-eslint/member-ordering': ['error'],
'@typescript-eslint/no-namespace': ['error'],
'@typescript-eslint/no-require-imports': ['error'],
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'off',
Expand Down
2 changes: 1 addition & 1 deletion ignores.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ module.exports = function gitignore(...extra) {
}
}

return [...ignores, ...extra];
return Array.from(new Set([...ignores.sort((a, b) => (a > b ? -1 : a == b ? 0 : 1)), ...extra]));
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@eduzz/eslint-config",
"private": false,
"version": "2.0.1",
"version": "2.1.0",
"keywords": [
"eduzz",
"eslint"
Expand All @@ -25,6 +25,7 @@
},
"dependencies": {
"@eduzz/eslint-config": "^2.0.0-beta.0",
"@eslint/compat": "^1.0.3",
"@types/eslint": "^8.56.10",
"eslint": "^9",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -33,6 +34,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-unused-imports": "^4.0.0",
"parse-gitignore": "^2.0.0",
"prettier": "^3.3.0",
Expand Down
17 changes: 16 additions & 1 deletion react-native.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
const { configs } = require('./react');
const { fixupPluginRules } = require('@eslint/compat');
const pluginReactNative = require('eslint-plugin-react-native');

const ignores = require('./ignores');

module.exports = {
ignores,
configs
/** @type import('eslint').Linter.FlatConfig[] */
configs: [
...configs,
{
name: '@eduzz/eslint-config-react-native',
plugins: {
'react-native': fixupPluginRules(pluginReactNative)
},
rules: {
'react-native/no-inline-styles': ['warn'],
'react-native/no-unused-styles': ['error']
}
}
]
};
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63"
integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==

"@eslint/compat@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@eslint/compat/-/compat-1.0.3.tgz#6be44cf553a14a2f68fafb304818f7d824a7248f"
integrity sha512-9RaroPQaU2+SDcWav1YfuipwqnHccoiXZdUsicRQsQ/vH2wkEmRVcj344GapG/FnCeZRtqj0n6PshI+s9xkkAQ==

"@eslint/config-array@^0.15.1":
version "0.15.1"
resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.15.1.tgz#1fa78b422d98f4e7979f2211a1fde137e26c7d61"
Expand Down Expand Up @@ -710,6 +715,18 @@ eslint-plugin-react-hooks@^4.6.2:
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596"
integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==

eslint-plugin-react-native-globals@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz#ee1348bc2ceb912303ce6bdbd22e2f045ea86ea2"
integrity sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g==

eslint-plugin-react-native@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-native/-/eslint-plugin-react-native-4.1.0.tgz#5343acd3b2246bc1b857ac38be708f070d18809f"
integrity sha512-QLo7rzTBOl43FvVqDdq5Ql9IoElIuTdjrz9SKAXCvULvBoRZ44JGSkx9z4999ZusCsb4rK3gjS8gOGyeYqZv2Q==
dependencies:
eslint-plugin-react-native-globals "^0.1.1"

eslint-plugin-react@^7.34.2:
version "7.34.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.34.2.tgz#2780a1a35a51aca379d86d29b9a72adc6bfe6b66"
Expand Down

0 comments on commit 081d5f0

Please sign in to comment.