@zimbra/eslint-config 0.0.1

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/RULES.md ADDED
@@ -0,0 +1,387 @@
1
+ # RULES
2
+
3
+ This file is generated from `src/rules/` and `src/rules/custom-rules/`. It lists the rule modules and explains, in simple language, what each rule or setting does. Keep this file up to date when rules change.
4
+
5
+ ---
6
+
7
+ ## **src/rules/automation.js**
8
+
9
+ Purpose: Rules for automation scripts (CI, build tools, scripts). These relax some checks that are noisy or unnecessary in short scripts.
10
+
11
+ Rules and what they do:
12
+
13
+ - `prettier/prettier`: off — do not run Prettier formatting checks in automation blocks.
14
+ - `prefer-const`: off — allow `let` even when a variable could be `const` (useful in scripting patterns).
15
+ - `require-atomic-updates`: off — do not warn about certain async update race conditions.
16
+ - `guard-for-in`: off — do not require `hasOwnProperty` checks in `for..in` loops.
17
+ - `react/jsx-no-useless-fragment`: off — allow fragments even if they look redundant.
18
+ - `lines-around-comment`: off — disable rules enforcing blank lines around comments.
19
+ - `no-unexpected-multiline`: off — do not warn for some ambiguous multi-line expressions.
20
+ - `no-spaced-func`: off — allow `function` call spacing (compatibility choice).
21
+ - `new-cap`: off — do not require constructor names to be capitalized.
22
+ - `no-undef-init`: off — allow `var x = undefined` style patterns.
23
+ - `no-shadow`: off — allow variable shadowing in automation scripts.
24
+ - `no-case-declarations`: off — allow declarations inside `switch` cases.
25
+ - `no-constant-binary-expression`: off — do not warn for constant expressions in binary operators.
26
+ - `semi`: ["error", "always"] — require semicolons at the end of statements.
27
+
28
+ Source: `src/rules/automation.js`
29
+
30
+ ---
31
+
32
+ ## **src/rules/i18n.js**
33
+
34
+ Purpose: Checks for localization (i18n) JSON files and i18n usage in templates.
35
+
36
+ Rules and what they do:
37
+
38
+ - `i18n-json/sorted-keys` — enforces a stable, custom key order in locale JSON files (uses `scripts/intl/lint-custom-sort.cjs`). This keeps translations sorted in a consistent order.
39
+ - `i18n-json/identical-keys` — ensures locale files have the same keys as the primary language file (defaults to `src/intl/en_US.json`).
40
+ - `preact-i18n/no-missing-template-field` — reports when a template expects a field that's not provided.
41
+ - `preact-i18n/no-text-as-attribute` — prevents raw text used directly in attributes instead of using translations.
42
+ - `preact-i18n/no-text-as-children` — prevents raw text as children in i18n-aware components (ignores small punctuation-only strings).
43
+ - `preact-i18n/no-unknown-key` — reports when a translation key used in code is not found in the locale files.
44
+
45
+ Notes:
46
+ - Use `ESLINT_INTL_PATH` environment variable to change where locale files are read from.
47
+
48
+ Source: `src/rules/i18n.js`
49
+
50
+ ---
51
+
52
+ ## **src/rules/import.js**
53
+
54
+ Purpose: Small adjustments for import-related checks.
55
+
56
+ Rules and what they do:
57
+
58
+ - `import/no-unresolved`: off — do not treat unresolved imports as errors (useful when bundlers or custom resolvers are in use).
59
+ - `import/no-named-as-default`: off — allow using a named export as default in some patterns.
60
+
61
+ Source: `src/rules/import.js`
62
+
63
+ ---
64
+
65
+ ## **src/rules/parser.js**
66
+
67
+ Purpose: Central parser configuration used for TypeScript-enabled linting blocks.
68
+
69
+ What it sets:
70
+
71
+ - `parser`: `@typescript-eslint/parser` — enables TypeScript-aware parsing.
72
+ - `sourceType`: `module` — treat files as ES modules.
73
+ - `ecmaVersion`: `latest` — allow modern JavaScript syntax.
74
+ - `parserOptions.requireConfigFile`: false — parser won't require a tsconfig for basic parsing.
75
+ - `parserOptions.ecmaFeatures.jsx`: true — enable JSX parsing.
76
+
77
+ Use this parser settings block when enabling TypeScript rules or type-aware checks.
78
+
79
+ Source: `src/rules/parser.js`
80
+
81
+ ---
82
+
83
+ ## **src/rules/prettier.js**
84
+
85
+ Purpose: Configure Prettier options surfaced through ESLint.
86
+
87
+ Rule and options:
88
+
89
+ - `prettier/prettier`: `error` — formatting issues are reported as ESLint errors. Options set:
90
+ - `singleQuote: true` — prefer single quotes.
91
+ - `printWidth: 100` — wrap lines at 100 characters.
92
+ - `trailingComma: 'none'` — do not add trailing commas.
93
+ - `arrowParens: 'avoid'` — omit parentheses for single-arg arrow functions where possible.
94
+
95
+ Note: Consumer projects should install `prettier` to get fixes via `eslint --fix`.
96
+
97
+ Source: `src/rules/prettier.js`
98
+
99
+ ---
100
+
101
+ ## **src/rules/react-hooks.js**
102
+
103
+ Purpose: Adjust React Hooks plugin rules for Zimbra code style.
104
+
105
+ Rules and what they do:
106
+
107
+ - `react-hooks/refs`: off — disables the `refs` rule from the react-hooks plugin.
108
+ - `react-hooks/immutability`: off — disables immutability checks for hooks-related code.
109
+
110
+ These are turned off to avoid false positives or to match our patterns across codebases.
111
+
112
+ Source: `src/rules/react-hooks.js`
113
+
114
+ ---
115
+
116
+ ## **src/rules/react.js**
117
+
118
+ Purpose: React-specific rule adjustments for modern code (often TypeScript-based).
119
+
120
+ Rules and what they do:
121
+
122
+ - `react/prop-types`: off — do not require PropTypes (TypeScript or other systems handle type checks).
123
+ - `react/no-unknown-property`: off — allow some non-standard attributes (project-specific usage).
124
+ - `react/react-in-jsx-scope`: off — no longer required with newer JSX transforms.
125
+ - `react/jsx-key`: off — JSX key warnings are disabled (teams may use different patterns).
126
+
127
+ Source: `src/rules/react.js`
128
+
129
+ ---
130
+
131
+ ## **src/rules/style.js**
132
+
133
+ Purpose: Style and code-shape rules that affect common JavaScript patterns.
134
+
135
+ Rules and what they do:
136
+
137
+ - `no-undef`: off — do not report undefined variables here (TypeScript or other checks may handle this).
138
+ - `no-unsafe-optional-chaining`: off — allow some optional chaining patterns that would otherwise be flagged.
139
+ - `no-empty`: off — allow empty blocks in some cases.
140
+ - `no-empty-pattern`: off — allow empty destructuring patterns.
141
+ - `no-unused-vars`: `['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true, caughtErrors: 'none' }]` — report unused variables, but ignore some common patterns (e.g., rest siblings).
142
+
143
+ Source: `src/rules/style.js`
144
+
145
+ ---
146
+
147
+ ## **src/rules/typescript.js**
148
+
149
+ Purpose: Turn off some `@typescript-eslint` rules that are noisy by default across many projects.
150
+
151
+ Rules and what they do:
152
+
153
+ - `@typescript-eslint/no-explicit-any`: off — allow `any` types in code without lint errors.
154
+ - `@typescript-eslint/no-empty-object-type`: off — allow `{} as type` patterns.
155
+ - `@typescript-eslint/no-unused-expressions`: off — allow certain unused expressions.
156
+ - `@typescript-eslint/no-unsafe-function-type`: off — do not error on some unsafe function types.
157
+ - `@typescript-eslint/no-unused-vars`: off — TypeScript-based unused-var handling may be preferred or tightened per-project.
158
+
159
+ Note: Projects that want stricter TypeScript rules should override these settings in their local config.
160
+
161
+ Source: `src/rules/typescript.js`
162
+
163
+ ---
164
+
165
+ ## **src/rules/custom-rules/custom-rules.js**
166
+
167
+ Purpose: Enables custom (project-specific) rules located in `src/rules/custom-rules/`.
168
+
169
+ Key setting:
170
+
171
+ - `custom/no-direct-memoize`: `error` — enable the rule that blocks direct memoize imports.
172
+
173
+ Source: `src/rules/custom-rules/custom-rules.js`
174
+
175
+ ---
176
+
177
+ ## **src/rules/custom-rules/no-direct-memoize.js**
178
+
179
+ Purpose: A custom rule that prevents importing certain memoize helpers directly.
180
+
181
+ What it enforces:
182
+
183
+ - Disallows imports of `es-toolkit/compat/memoize` and `es-toolkit/memoize`.
184
+ - Reports an error and recommends using `createLRUMemoize` instead.
185
+
186
+ Why: Centralizes use of a specific memoize implementation (LRU-based) and avoids inconsistent memoization helpers.
187
+
188
+ Example that triggers the rule:
189
+
190
+ ```js
191
+ import memoize from 'es-toolkit/memoize'; // ❌ triggers rule
192
+ const x = memoize(fn);
193
+ ```
194
+
195
+ Example that follows the rule:
196
+
197
+ ```js
198
+ import { createLRUMemoize } from 'some-lru-helper'; // ✅ allowed
199
+ const memo = createLRUMemoize(...);
200
+ ```
201
+
202
+ Source: `src/rules/custom-rules/no-direct-memoize.js`
203
+
204
+ # RULES
205
+
206
+ This file was generated automatically from the source files under `src/rules/` and `src/rules/custom-rules/`. It summarizes the purpose and key settings for each rule/config module exported by the package. If you change rules in `src/rules`, regenerate this file or update it manually.
207
+
208
+ ---
209
+
210
+ ## **src/rules/automation.js**
211
+
212
+ Purpose: Relax or adjust linting rules for automation and CI scripts. The automation rules turn off several stylistic and runtime checks that are commonly noisy in automation scripts and set a required semicolon style.
213
+
214
+ Key settings (excerpt):
215
+
216
+ - `prettier/prettier`: off
217
+ - `prefer-const`: off
218
+ - `require-atomic-updates`: off
219
+ - `guard-for-in`: off
220
+ - `semi`: ["error", "always"]
221
+
222
+ Use when: applying lint rules to scripts used in CI, build tooling, or non-interactive environments where stricter runtime style checks may be unnecessary.
223
+
224
+ Source: `src/rules/automation.js`
225
+
226
+ ---
227
+
228
+ ## **src/rules/i18n.js**
229
+
230
+ Purpose: Provide i18n-related rules and configuration for both JSON locale files and Preact/Preact-i18n usage.
231
+
232
+ What it contains:
233
+
234
+ - `i18nJsonRules` — configuration for `eslint-plugin-i18n-json`, including a custom sort function (`scripts/intl/lint-custom-sort.cjs`) and reference to the primary language file (defaults to `src/intl/en_US.json` or overridden via `ESLINT_INTL_PATH`).
235
+ - `i18nRules` — runtime/template checks for Preact i18n (e.g. `no-missing-template-field`, `no-text-as-attribute`).
236
+ - `LANGUAGE_FILES_RELATIVE` — a list of supported language filename mappings included for reference.
237
+ - `i18nTextComponents` — helper patterns used to identify text-containing components for i18n checks.
238
+
239
+ Notes:
240
+
241
+ - `ESLINT_INTL_PATH` env var can override the default locale path.
242
+ - Useful for projects that validate JSON locale files and enforce i18n usage in templates.
243
+
244
+ Source: `src/rules/i18n.js`
245
+
246
+ ---
247
+
248
+ ## **src/rules/import.js**
249
+
250
+ Purpose: Minimal adjustments for `eslint-plugin-import` rules in this config.
251
+
252
+ Key settings (excerpt):
253
+
254
+ - `import/no-unresolved`: off
255
+ - `import/no-named-as-default`: off
256
+
257
+ Source: `src/rules/import.js`
258
+
259
+ ---
260
+
261
+ ## **src/rules/parser.js**
262
+
263
+ Purpose: Centralized parser configuration for TypeScript-aware parsing.
264
+
265
+ Key settings:
266
+
267
+ - `parser`: `@typescript-eslint/parser`
268
+ - `sourceType`: `module`
269
+ - `ecmaVersion`: `latest`
270
+ - `parserOptions.requireConfigFile`: false
271
+ - `parserOptions.ecmaFeatures.jsx`: true
272
+
273
+ Use when: enabling TypeScript rules or type-aware linting blocks.
274
+
275
+ Source: `src/rules/parser.js`
276
+
277
+ ---
278
+
279
+ ## **src/rules/prettier.js**
280
+
281
+ Purpose: Prettier integration settings exposed as an ESLint rule block.
282
+
283
+ Key settings (excerpt):
284
+
285
+ - `prettier/prettier`: `error` with options: `singleQuote: true`, `printWidth: 100`, `trailingComma: 'none'`, `arrowParens: 'avoid'`.
286
+
287
+ This file configures Prettier rules so that formatting errors are surfaced by ESLint and can be fixed with `eslint --fix` when `prettier` and `eslint-plugin-prettier` are present.
288
+
289
+ Source: `src/rules/prettier.js`
290
+
291
+ ---
292
+
293
+ ## **src/rules/react-hooks.js**
294
+
295
+ Purpose: Adjust React Hooks-related rules. This config disables certain rules from `eslint-plugin-react-hooks` that are not desired across Zimbra codebases.
296
+
297
+ Key settings:
298
+
299
+ - `react-hooks/refs`: off
300
+ - `react-hooks/immutability`: off
301
+
302
+ Source: `src/rules/react-hooks.js`
303
+
304
+ ---
305
+
306
+ ## **src/rules/react.js**
307
+
308
+ Purpose: React-specific rule adjustments. The config turns off prop-types and other rules that are unnecessary in modern TypeScript/React codebases or in projects that use other type systems.
309
+
310
+ Key settings (excerpt):
311
+
312
+ - `react/prop-types`: off
313
+ - `react/no-unknown-property`: off
314
+ - `react/react-in-jsx-scope`: off
315
+ - `react/jsx-key`: off
316
+
317
+ Source: `src/rules/react.js`
318
+
319
+ ---
320
+
321
+ ## **src/rules/style.js**
322
+
323
+ Purpose: Style and basic code-shape rules. Controls undefined variables, empty patterns, and unused variable behavior.
324
+
325
+ Key settings (excerpt):
326
+
327
+ - `no-undef`: off
328
+ - `no-empty`: off
329
+ - `no-unused-vars`: `['error',{vars:'all',args:'after-used',ignoreRestSiblings:true,caughtErrors:'none'}]`
330
+
331
+ Source: `src/rules/style.js`
332
+
333
+ ---
334
+
335
+ ## **src/rules/typescript.js**
336
+
337
+ Purpose: TypeScript-focused rule overrides using `@typescript-eslint` plugin.
338
+
339
+ Key settings (excerpt):
340
+
341
+ - `@typescript-eslint/no-explicit-any`: off
342
+ - `@typescript-eslint/no-unused-vars`: off
343
+ - `@typescript-eslint/no-empty-object-type`: off
344
+
345
+ These relax certain strict checks which may otherwise be noisy across the codebase; enable stronger checks by overriding in a project's local config if desired.
346
+
347
+ Source: `src/rules/typescript.js`
348
+
349
+ ---
350
+
351
+ ## **src/rules/custom-rules/custom-rules.js**
352
+
353
+ Purpose: Enable custom rules defined in `src/rules/custom-rules/`.
354
+
355
+ Key setting:
356
+
357
+ - `custom/no-direct-memoize`: `error`
358
+
359
+ This file acts as a small wrapper to enable Zimbra-specific custom rules.
360
+
361
+ Source: `src/rules/custom-rules/custom-rules.js`
362
+
363
+ ---
364
+
365
+ ## **src/rules/custom-rules/no-direct-memoize.js**
366
+
367
+ Purpose: Custom lint rule that disallows direct imports of `es-toolkit/compat/memoize` and `es-toolkit/memoize` and instructs developers to use `createLRUMemoize` instead.
368
+
369
+ Metadata from the rule (auto-extracted):
370
+
371
+ - **Description**: Disallow direct import of es-toolkit/compat/memoize or es-toolkit/memoize; use createLRUMemoize
372
+ - **Type**: problem
373
+ - **Recommended**: true
374
+ - **Message**: "Do not import es-toolkit/compat/memoize or es-toolkit/memoize; directly. Use 'createLRUMemoize' instead."
375
+
376
+ Behavior summary:
377
+
378
+ - Reports on ES module `ImportDeclaration` nodes when the source matches any disallowed module.
379
+ - Reports on `require()` calls with the same disallowed modules.
380
+
381
+ Source: `src/rules/custom-rules/no-direct-memoize.js`
382
+
383
+ ---
384
+
385
+ How this file was generated
386
+
387
+ This `RULES.md` was produced by extracting obvious descriptions, top-level settings, and JSDoc-like metadata from the rule/config source files. It is intended as a concise human-readable summary; for implementation details and exact rule shapes, refer to the original source files under `src/rules/`.
@@ -0,0 +1,5 @@
1
+ import { coreJsConfig } from "./src/index.js";
2
+
3
+ export default [
4
+ ...coreJsConfig
5
+ ];
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@zimbra/eslint-config",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "description": "ESLint configuration for Zimbra javascript projects.",
6
+ "main": "src/index.js",
7
+ "exports": {
8
+ ".": "./src/index.js",
9
+ "./typescript": "./src/typescript.js"
10
+ },
11
+ "scripts": {
12
+ "lint": "eslint src",
13
+ "lint:fix": "npm run lint -- --fix"
14
+ },
15
+ "dependencies": {
16
+ "@eslint/compat": "^1.0.0",
17
+ "@eslint/js": "^9.37.0",
18
+ "eslint-config-prettier": "^9.1.0",
19
+ "eslint-plugin-i18n-json": "^4.0.1",
20
+ "eslint-plugin-import": "^2.32.0",
21
+ "eslint-plugin-mocha": "^10.2.0",
22
+ "eslint-plugin-preact-i18n": "^1.1.0",
23
+ "eslint-plugin-prettier": "^5.1.3",
24
+ "eslint-plugin-react": "^7.37.5",
25
+ "eslint-plugin-react-hooks": "^7.0.1",
26
+ "eslint-plugin-testcafe": "^0.2.1",
27
+ "typescript": "^5.9.3",
28
+ "@typescript-eslint/parser": "^8.48.1",
29
+ "globals": "^15.15.0",
30
+ "prettier": "^3.6.2"
31
+ },
32
+ "peerDependencies": {
33
+ "eslint": "^9.37.0",
34
+ "@typescript-eslint/eslint-plugin": "^8.50.1"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "@typescript-eslint/eslint-plugin": {
38
+ "optional": true
39
+ }
40
+ },
41
+ "devDependencies": {
42
+ "eslint": "^9.0.0",
43
+ "@typescript-eslint/eslint-plugin": "^8.50.1"
44
+ }
45
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = translations => {
2
+ return Object.keys(translations).sort((keyA, keyB) => {
3
+ return keyA.localeCompare(keyB, undefined, {
4
+ numeric: true,
5
+ sensitivity: 'base'
6
+ });
7
+ });
8
+ };
@@ -0,0 +1,16 @@
1
+ import testcafePlugin from 'eslint-plugin-testcafe';
2
+ import { automationRules } from '../rules/automation.js';
3
+
4
+ export default [
5
+ {
6
+ files: ['test/**/*.{js,jsx,mjs,cjs}', 'tests/**/*.{js,jsx,mjs,cjs}'],
7
+ ignores: ['**/node_modules/*', '**/dist/*', '**/build/*'],
8
+ plugins: {
9
+ testcafePlugin: testcafePlugin
10
+ },
11
+ rules: {
12
+ ...testcafePlugin.configs.recommended.rules,
13
+ ...automationRules
14
+ }
15
+ }
16
+ ];
@@ -0,0 +1,79 @@
1
+ import eslint from '@eslint/js';
2
+ import { fixupPluginRules } from '@eslint/compat';
3
+ import globals from 'globals';
4
+ import path from 'path';
5
+
6
+ import prettierConfig from 'eslint-config-prettier';
7
+ import pluginPrettier from 'eslint-plugin-prettier';
8
+ import pluginMocha from 'eslint-plugin-mocha';
9
+ import pluginPreactI18n from 'eslint-plugin-preact-i18n';
10
+ import pluginReact from 'eslint-plugin-react';
11
+ import pluginReactHooks from 'eslint-plugin-react-hooks';
12
+ import importPlugin from 'eslint-plugin-import';
13
+
14
+ import styleRules from '../rules/style.js';
15
+ import reactRules from '../rules/react.js';
16
+ import reactHooksRules from '../rules/react-hooks.js';
17
+ import importRules from '../rules/import.js';
18
+ import { i18nRules, LANGUAGE_FILES_RELATIVE, i18nTextComponents } from '../rules/i18n.js';
19
+ import prettierRules from '../rules/prettier.js';
20
+ import parserConfig from '../rules/parser.js';
21
+
22
+ const coreRules = {
23
+ ...styleRules,
24
+ ...reactRules,
25
+ ...reactHooksRules,
26
+ ...importRules,
27
+ ...prettierRules,
28
+ ...i18nRules
29
+ };
30
+
31
+ const intlPath = process.env.ESLINT_INTL_PATH ?? 'src/intl';
32
+
33
+ const languageFilesAbsolute = LANGUAGE_FILES_RELATIVE.map(entry => ({
34
+ name: entry.name,
35
+ path: path.join(intlPath, entry.filename)
36
+ }));
37
+
38
+ export default [
39
+ {
40
+ files: ['**/*.{js,jsx,mjs,cjs}'],
41
+
42
+ ignores: ['**/node_modules/*', '**/dist/*', '**/build/*', '**/*.graphql', '**/*.gql'],
43
+
44
+ languageOptions: {
45
+ ...parserConfig,
46
+ globals: {
47
+ ...globals.browser,
48
+ ...globals.node
49
+ }
50
+ },
51
+
52
+ plugins: {
53
+ react: pluginReact,
54
+ 'react-hooks': pluginReactHooks,
55
+ mocha: fixupPluginRules(pluginMocha),
56
+ prettier: pluginPrettier,
57
+ import: importPlugin,
58
+ // TODO: Upgrade `pluginPreactI18n` to a modern version to ensure compatibility with current tooling and React/Preact best practices
59
+ 'preact-i18n': fixupPluginRules(pluginPreactI18n)
60
+ },
61
+
62
+ rules: {
63
+ ...eslint.configs.recommended.rules,
64
+ ...prettierConfig.rules,
65
+ ...pluginReact.configs.recommended.rules,
66
+ ...pluginReactHooks.configs.recommended.rules,
67
+ ...importPlugin.configs.recommended.rules,
68
+ ...coreRules
69
+ },
70
+
71
+ settings: {
72
+ react: { pragma: 'createElement', version: '16.3' },
73
+ 'preact-i18n': {
74
+ languageFiles: languageFilesAbsolute,
75
+ textComponents: i18nTextComponents
76
+ }
77
+ }
78
+ }
79
+ ];
@@ -0,0 +1,19 @@
1
+ import customRules from '../rules/custom-rules/custom-rules.js';
2
+ import noDirectMemoize from '../rules/custom-rules/no-direct-memoize.js';
3
+
4
+ export default [
5
+ {
6
+ files: ['**/*.{js,jsx,mjs,cjs}'],
7
+ ignores: ['**/node_modules/*', '**/dist/*', '**/build/*'],
8
+ plugins: {
9
+ custom: {
10
+ rules: {
11
+ 'no-direct-memoize': noDirectMemoize
12
+ }
13
+ }
14
+ },
15
+ rules: {
16
+ ...customRules
17
+ }
18
+ }
19
+ ];
@@ -0,0 +1,20 @@
1
+ import pluginI18nJson from 'eslint-plugin-i18n-json';
2
+ import { i18nJsonRules } from '../rules/i18n.js';
3
+
4
+ export default [
5
+ {
6
+ files: ['**/*.json'],
7
+ ignores: ['**/node_modules/*', '**/dist/*', '**/build/*'],
8
+ plugins: {
9
+ 'i18n-json': pluginI18nJson
10
+ },
11
+ processor: {
12
+ meta: { name: '.json' },
13
+ ...pluginI18nJson.processors['.json']
14
+ },
15
+ rules: {
16
+ ...pluginI18nJson.configs.recommended.rules,
17
+ ...i18nJsonRules
18
+ }
19
+ }
20
+ ];
@@ -0,0 +1,33 @@
1
+ import pluginPrettier from 'eslint-plugin-prettier';
2
+ import tsParser from '@typescript-eslint/parser';
3
+ import pluginTypescript from '@typescript-eslint/eslint-plugin';
4
+ import importPlugin from 'eslint-plugin-import';
5
+ import typescriptRules from '../rules/typescript.js';
6
+ import prettierRules from '../rules/prettier.js';
7
+
8
+ export default [
9
+ {
10
+ ignores: ['**/dist/**', '**/build/**', '**/node_modules/**', '**/*.d.ts']
11
+ },
12
+ {
13
+ files: ['**/*.{ts,tsx}'],
14
+ languageOptions: {
15
+ parser: tsParser,
16
+ sourceType: 'module',
17
+ ecmaVersion: 'latest',
18
+ parserOptions: {
19
+ project: true
20
+ }
21
+ },
22
+ plugins: {
23
+ '@typescript-eslint': pluginTypescript,
24
+ import: importPlugin,
25
+ prettier: pluginPrettier
26
+ },
27
+ rules: {
28
+ ...pluginTypescript.configs.recommended.rules,
29
+ ...prettierRules,
30
+ ...typescriptRules
31
+ }
32
+ }
33
+ ];
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import automationConfig from './configs/automation-config.js';
2
+ import localeJsonConfig from './configs/locale-json-config.js';
3
+ import coreJsConfig from './configs/core-js-config.js';
4
+ import customConfig from './configs/custom-config.js';
5
+
6
+ export { coreJsConfig, localeJsonConfig, automationConfig, customConfig };
@@ -0,0 +1,16 @@
1
+ export const automationRules = {
2
+ 'prettier/prettier': 'off',
3
+ 'prefer-const': 'off',
4
+ 'require-atomic-updates': 'off',
5
+ 'guard-for-in': 'off',
6
+ 'react/jsx-no-useless-fragment': 'off',
7
+ 'lines-around-comment': 'off',
8
+ 'no-unexpected-multiline': 'off',
9
+ 'no-spaced-func': 'off',
10
+ 'new-cap': 'off',
11
+ 'no-undef-init': 'off',
12
+ 'no-shadow': 'off',
13
+ 'no-case-declarations': 'off',
14
+ 'no-constant-binary-expression': 'off',
15
+ semi: ['error', 'always']
16
+ };
@@ -0,0 +1,3 @@
1
+ export default {
2
+ 'custom/no-direct-memoize': 'error'
3
+ };