@kununu/eslint-config 5.2.3-beta-7 → 5.2.3-beta-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +14 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Import the plugin directly
|
|
2
|
+
const kununuPlugin = require('./plugins/kununu');
|
|
3
|
+
|
|
1
4
|
// we need to have the baseRules to have the same on the typescript override
|
|
2
5
|
// because it has extends the eslint does not take into consideration the ones from the base
|
|
3
6
|
const baseRules = {
|
|
@@ -204,14 +207,11 @@ const baseRules = {
|
|
|
204
207
|
// https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops
|
|
205
208
|
'react/require-default-props': 0,
|
|
206
209
|
|
|
210
|
+
'prefer-early-return': 'error',
|
|
207
211
|
};
|
|
208
212
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
// Register it using this prefix
|
|
212
|
-
const pluginPrefix = '@kununu/eslint-config/plugins/kununu';
|
|
213
|
-
|
|
214
|
-
module.exports = {
|
|
213
|
+
// Create the ESLint config
|
|
214
|
+
const config = {
|
|
215
215
|
extends: [
|
|
216
216
|
'airbnb', // Many strict rules for ECMAScript and React
|
|
217
217
|
'airbnb/hooks',
|
|
@@ -228,7 +228,6 @@ module.exports = {
|
|
|
228
228
|
'@babel',
|
|
229
229
|
'lodash',
|
|
230
230
|
'sort-destructure-keys',
|
|
231
|
-
pluginPrefix
|
|
232
231
|
],
|
|
233
232
|
|
|
234
233
|
env: {
|
|
@@ -240,7 +239,7 @@ module.exports = {
|
|
|
240
239
|
|
|
241
240
|
rules: {
|
|
242
241
|
...baseRules,
|
|
243
|
-
|
|
242
|
+
'local/prefer-early-return': 'error',
|
|
244
243
|
},
|
|
245
244
|
|
|
246
245
|
overrides: [{
|
|
@@ -304,3 +303,10 @@ module.exports = {
|
|
|
304
303
|
}
|
|
305
304
|
}],
|
|
306
305
|
};
|
|
306
|
+
|
|
307
|
+
// Export the config
|
|
308
|
+
module.exports = config;
|
|
309
|
+
|
|
310
|
+
module.exports.plugins = {
|
|
311
|
+
'local': kununuPlugin
|
|
312
|
+
};
|