@shelf/eslint-config 6.1.1 → 6.2.0

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/README.md CHANGED
@@ -40,8 +40,7 @@ export default [
40
40
  ## Publish
41
41
 
42
42
  ```sh
43
- $ pnpm version patch
44
- $ git push --follow-tags
43
+ $ pnpx np
45
44
  ```
46
45
 
47
46
  ## License
package/base.js CHANGED
@@ -11,6 +11,10 @@ import preferEs6 from './rules/prefer-es6.js';
11
11
  import importOrder from './rules/import-order.js';
12
12
  import sortImports from './rules/sort-imports.js';
13
13
  import comments from './rules/comments.js';
14
+ import defaultBarrelExports, {
15
+ barrelPagesOverride,
16
+ barrelPlugin,
17
+ } from './rules/default-barrel-exports.js';
14
18
 
15
19
  const jestFormattingCompat = fixupPluginRules(jestFormatting);
16
20
 
@@ -29,6 +33,7 @@ export default [
29
33
  plugins: {
30
34
  prettier,
31
35
  '@stylistic': stylistic,
36
+ ...barrelPlugin,
32
37
  },
33
38
 
34
39
  languageOptions: {
@@ -51,6 +56,7 @@ export default [
51
56
  ...importOrder,
52
57
  ...sortImports,
53
58
  ...comments,
59
+ ...defaultBarrelExports,
54
60
  'comma-dangle': 'off',
55
61
  camelcase: 'error',
56
62
  eqeqeq: ['error', 'smart'],
@@ -61,4 +67,5 @@ export default [
61
67
  'require-await': 'error',
62
68
  },
63
69
  },
70
+ barrelPagesOverride,
64
71
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shelf/eslint-config",
3
- "version": "6.1.1",
3
+ "version": "6.2.0",
4
4
  "description": "ESLint Config for Shelf Projects",
5
5
  "license": "MIT",
6
6
  "repository": "shelfio/eslint-config",
@@ -30,11 +30,12 @@
30
30
  "@eslint/eslintrc": "3.3.5",
31
31
  "@eslint/js": "10.0.1",
32
32
  "@stylistic/eslint-plugin": "5.10.0",
33
- "@typescript-eslint/eslint-plugin": "8.56.1",
34
- "@typescript-eslint/parser": "8.56.1",
33
+ "@typescript-eslint/eslint-plugin": "8.57.0",
34
+ "@typescript-eslint/parser": "8.57.0",
35
35
  "eslint-config-next": "16.1.6",
36
36
  "eslint-config-prettier": "10.1.8",
37
37
  "eslint-plugin-babel": "5.3.1",
38
+ "eslint-plugin-barrel-files": "3.0.1",
38
39
  "eslint-plugin-import": "2.32.0",
39
40
  "eslint-plugin-jest": "29.15.0",
40
41
  "eslint-plugin-jest-formatting": "3.1.0",
@@ -44,16 +45,16 @@
44
45
  "eslint-plugin-react": "7.37.5",
45
46
  "eslint-plugin-react-hooks": "7.0.1",
46
47
  "eslint-plugin-shelf-no-need-lodash-methods": "2.0.8",
47
- "eslint-plugin-sonarjs": "4.0.1",
48
+ "eslint-plugin-sonarjs": "4.0.2",
48
49
  "eslint-plugin-testing-library": "7.16.0",
49
50
  "eslint-plugin-you-dont-need-lodash-underscore": "6.14.0",
50
51
  "globals": "17.4.0",
51
- "typescript-eslint": "8.56.1"
52
+ "typescript-eslint": "8.57.0"
52
53
  },
53
54
  "devDependencies": {
54
55
  "eslint": "10.0.3",
55
56
  "husky": "9.1.7",
56
- "lint-staged": "16.3.2",
57
+ "lint-staged": "16.4.0",
57
58
  "prettier": "3.8.1"
58
59
  },
59
60
  "peerDependencies": {
@@ -0,0 +1,21 @@
1
+ import barrelFiles from 'eslint-plugin-barrel-files';
2
+
3
+ export const barrelPlugin = {'barrel-files': barrelFiles};
4
+
5
+ const defaultBarrelExports = {
6
+ 'import/no-default-export': 'warn',
7
+ 'import/prefer-default-export': 'off',
8
+ 'barrel-files/avoid-barrel-files': [
9
+ 'warn',
10
+ {
11
+ amountOfExportsToConsiderModuleAsBarrel: 0,
12
+ },
13
+ ],
14
+ };
15
+
16
+ export const barrelPagesOverride = {
17
+ files: ['pages/**/*.{js,jsx,ts,tsx}'],
18
+ rules: {'import/no-default-export': 'off'},
19
+ };
20
+
21
+ export default defaultBarrelExports;