aberlaas-lint 2.18.1 → 2.19.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.
Files changed (2) hide show
  1. package/configs/eslint.js +38 -5
  2. package/package.json +3 -2
package/configs/eslint.js CHANGED
@@ -1,9 +1,10 @@
1
- import js from '@eslint/js';
2
1
  import globals from 'globals';
3
- import pluginN from 'eslint-plugin-n';
2
+ import js from '@eslint/js';
4
3
  import pluginImport from 'eslint-plugin-import';
5
4
  import pluginJsdoc from 'eslint-plugin-jsdoc';
5
+ import pluginN from 'eslint-plugin-n';
6
6
  import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
7
+ import pluginReact from 'eslint-plugin-react';
7
8
  // Note:
8
9
  // It is currently required to manually add typescript and
9
10
  // @typescript-eslint/utils to aberlaas for the plugin to work
@@ -75,6 +76,7 @@ export default [
75
76
  message: 'Typo: Use _.padStart instead',
76
77
  },
77
78
  ],
79
+ 'no-shadow': ['error'],
78
80
  'no-unused-vars': [
79
81
  'error',
80
82
  {
@@ -83,10 +85,17 @@ export default [
83
85
  caughtErrorsIgnorePattern: '^_.',
84
86
  },
85
87
  ],
86
- 'no-shadow': ['error'],
88
+ 'no-use-before-define': [
89
+ 'error',
90
+ {
91
+ variables: true,
92
+ functions: false,
93
+ },
94
+ ],
87
95
  'object-shorthand': ['error', 'always'],
88
96
  'quote-props': ['error', 'consistent-as-needed'],
89
97
  'sort-imports': ['error', { ignoreDeclarationSort: true }],
98
+
90
99
  // Node
91
100
  'n/no-unsupported-features/es-syntax': [
92
101
  'error',
@@ -95,6 +104,7 @@ export default [
95
104
  'n/no-extraneous-import': ['error'],
96
105
  'n/no-unpublished-import': ['error'],
97
106
  'n/prefer-node-protocol': ['error'],
107
+
98
108
  // Import
99
109
  'import/first': ['error'],
100
110
  'import/no-cycle': ['error', { ignoreExternal: true, disableScc: true }],
@@ -104,6 +114,7 @@ export default [
104
114
  // field in its package.json
105
115
  // See: https://github.com/lint-staged/lint-staged/issues/1474
106
116
  'import/no-unresolved': ['error', { ignore: ['lint-staged'] }],
117
+
107
118
  // JSDoc
108
119
  'jsdoc/check-param-names': ['warn'],
109
120
  'jsdoc/check-types': ['warn'],
@@ -122,6 +133,7 @@ export default [
122
133
  'jsdoc/require-returns-description': ['warn'],
123
134
  'jsdoc/require-returns-type': ['warn'],
124
135
  'jsdoc/valid-types': ['warn'],
136
+
125
137
  // Prettier
126
138
  ...pluginPrettierRecommended.rules,
127
139
  // Prettier overwrites
@@ -140,9 +152,11 @@ export default [
140
152
  //
141
153
  // Until this is fixed (see
142
154
  // https://github.com/import-js/eslint-plugin-import/issues/2430)
143
- // we manually define the most common extensions
155
+ // we manually define all common extensions including React/TypeScript
144
156
  'import/resolver': {
145
- node: { extensions: ['.js', '.cjs', '.mjs', '.d.ts'] },
157
+ node: {
158
+ extensions: ['.js', '.cjs', '.mjs', '.d.ts', '.jsx', '.ts', '.tsx'],
159
+ },
146
160
  },
147
161
  },
148
162
  },
@@ -195,6 +209,25 @@ export default [
195
209
  'vitest/prefer-to-contain': ['error'],
196
210
  },
197
211
  },
212
+ {
213
+ name: 'aberlaas/react',
214
+ files: ['**/*.{jsx,tsx}'],
215
+ plugins: {
216
+ react: pluginReact,
217
+ },
218
+ languageOptions: {
219
+ parserOptions: {
220
+ ecmaFeatures: {
221
+ jsx: true,
222
+ },
223
+ },
224
+ },
225
+ rules: {
226
+ 'react/jsx-uses-react': ['error'],
227
+ 'react/jsx-uses-vars': ['error'],
228
+ 'import/extensions': ['error', 'always', { ignorePackages: true }],
229
+ },
230
+ },
198
231
  {
199
232
  name: 'aberlaas/scripts',
200
233
  files: ['**/scripts/**/*.{js,ts}'],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "aberlaas-lint",
3
3
  "type": "module",
4
4
  "description": "aberlaas lint command: Lint files",
5
- "version": "2.18.1",
5
+ "version": "2.19.0",
6
6
  "repository": "pixelastic/aberlaas",
7
7
  "homepage": "https://projects.pixelastic.com/aberlaas/",
8
8
  "author": "Tim Carry (@pixelastic)",
@@ -50,6 +50,7 @@
50
50
  "eslint-plugin-jsdoc": "50.5.0",
51
51
  "eslint-plugin-n": "17.14.0",
52
52
  "eslint-plugin-prettier": "5.2.1",
53
+ "eslint-plugin-react": "7.37.5",
53
54
  "firost": "5.2.1",
54
55
  "globals": "15.14.0",
55
56
  "golgoth": "3.0.0",
@@ -58,5 +59,5 @@
58
59
  "typescript": "5.6.3",
59
60
  "yaml-lint": "1.7.0"
60
61
  },
61
- "gitHead": "00b60dcf9aebab442a809ccc81942005d87d1b5c"
62
+ "gitHead": "11175e8d126f535dc73a3aa942acd79f450d74c4"
62
63
  }