@mkaradeniz/eslint-config 5.7.0 → 5.9.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/next.mjs CHANGED
@@ -2,6 +2,7 @@ import eslintPluginNext from '@next/eslint-plugin-next';
2
2
 
3
3
  import { reactConfig } from './react.mjs';
4
4
  import { nextRules } from './rules/nextRules.mjs';
5
+ import { reactRules } from './rules/reactRules.mjs';
5
6
 
6
7
  export const nextConfig = [
7
8
  ...reactConfig,
@@ -56,4 +57,10 @@ export const nextConfig = [
56
57
  'unicorn/filename-case': ['off'],
57
58
  },
58
59
  },
60
+ {
61
+ files: ['**/instrumentation.ts', '**/instrumentation-client.ts'],
62
+ rules: {
63
+ 'no-restricted-syntax': ['warn', ...reactRules.rules['no-restricted-syntax'].slice(1).filter(s => !s.selector.includes('process'))],
64
+ },
65
+ },
59
66
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkaradeniz/eslint-config",
3
- "version": "5.7.0",
3
+ "version": "5.9.0",
4
4
  "private": false,
5
5
  "files": [
6
6
  "base.mjs",
@@ -114,6 +114,11 @@ export const baseRules = {
114
114
  message: 'Use envConfigClient or envConfigServer instead of process.env.',
115
115
  selector: 'MemberExpression[object.name="process"][property.name="env"]',
116
116
  },
117
+ {
118
+ message:
119
+ 'Prefer const + functional patterns (map/filter/reduce/ternary). Extract to a util function if needed. Only disable for: try/catch assignment, iterators/generators, for-await-of accumulation, or closures requiring mutable state (debounce, event handlers).',
120
+ selector: 'VariableDeclaration[kind="let"]',
121
+ },
117
122
  ],
118
123
  'no-return-assign': ['warn'],
119
124
  'no-script-url': ['warn'],