@open-turo/eslint-config-typescript 15.0.1 → 16.0.0-pr-373.3.1.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/legacy.js DELETED
@@ -1,128 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- es2022: true,
5
- jest: true,
6
- },
7
- parser: "@typescript-eslint/parser",
8
- ignorePatterns: ["jest.config.js"],
9
- plugins: [
10
- "@typescript-eslint",
11
- "eslint-plugin-jest",
12
- "import",
13
- "jest",
14
- "json",
15
- "n",
16
- "prettier",
17
- "simple-import-sort",
18
- "sonarjs",
19
- "sort-destructure-keys",
20
- "typescript-sort-keys",
21
- ],
22
- extends: [
23
- "eslint:recommended",
24
- "plugin:@typescript-eslint/recommended",
25
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
26
- "plugin:import/recommended",
27
- "plugin:import/typescript",
28
- "plugin:jest/recommended",
29
- "plugin:json/recommended-legacy",
30
- "plugin:n/recommended",
31
- "plugin:prettier/recommended",
32
- "plugin:sonarjs/recommended-legacy",
33
- "plugin:typescript-sort-keys/recommended",
34
- ],
35
- parserOptions: {
36
- ecmaVersion: 2022,
37
- project: "./tsconfig.json",
38
- },
39
- overrides: [
40
- {
41
- files: ["test/**"],
42
- plugins: ["jest"],
43
- rules: {
44
- // this turns the original rule off *only* for test files, for jest compatibility
45
- "@typescript-eslint/unbound-method": "off",
46
- "jest/unbound-method": "error",
47
- },
48
- },
49
- ],
50
- rules: {
51
- "import/default": "off",
52
- "import/named": "off",
53
- "import/namespace": "off",
54
- "import/no-default-export": "error",
55
- "import/no-extraneous-dependencies": [
56
- "error",
57
- {
58
- devDependencies: ["test/**/*.tsx", "test/**/*.ts"],
59
- },
60
- ],
61
- "import/export": "off",
62
- "import/prefer-default-export": "off",
63
- "jest/no-jest-import": "off",
64
- "json/*": "error",
65
- "n/no-unpublished-import": [
66
- "error",
67
- {
68
- allowModules: ["@jest/globals", "nock"],
69
- },
70
- ],
71
- "n/no-unsupported-features/es-syntax": "off",
72
- "n/no-missing-import": "off",
73
- "simple-import-sort/imports": "error",
74
- "simple-import-sort/exports": "error",
75
- "sort-destructure-keys/sort-destructure-keys": "error",
76
- // Noisy rule - we may have helpers/methods that we mark as @deprecated but aren't planning to remove in the near future. This rule also significantly adds to eslint running time, which slows down both local development and CI.
77
- "sonarjs/deprecation": "off",
78
- // This rule is not helpful in TypeScript files, and in JavaScript we often return different types from functions, so this is not a strictness level we want to enforce.
79
- "sonarjs/function-return-type": "off",
80
- // We may want to catch errors but not use the error object directly, just trigger error handling fallbacks within the catch block.
81
- "sonarjs/no-ignored-exceptions": "off",
82
- "sonarjs/no-nested-functions": ["warn", { threshold: 5 }],
83
- // Overlaps with @typescript-eslint/prefer-nullish-coalescing
84
- "sonarjs/prefer-nullish-coalescing": "off",
85
- // Overlaps with @typescript-eslint/no-unused-vars
86
- "sonarjs/no-unused-vars": "off",
87
- // Overlaps with @typescript-eslint/prefer-optional-chain
88
- "sonarjs/prefer-optional-chain": "off",
89
- // Useful for guarding against prop mutation in React, but too much of a lift as very rarely do we apply readonly/ReadonlyArray<T> to type definitions
90
- "sonarjs/prefer-read-only-props": "off",
91
- // Noisy rule: if we wanted stricter linting of TODOs, we could use unicorn/expiring-todo-comments
92
- "sonarjs/todo-tag": "off",
93
- // A useful rule to consider for libraries to better document (and export) type definitions, but noisy in app usages (especially around redux type definitions)
94
- "sonarjs/use-type-alias": "off",
95
- "@typescript-eslint/no-unused-vars": [
96
- "error",
97
- {
98
- // Allow to name unused vars with _
99
- argsIgnorePattern: "^_",
100
- },
101
- ],
102
- "@typescript-eslint/restrict-template-expressions": [
103
- "error",
104
- {
105
- allowBoolean: true,
106
- },
107
- ],
108
- "@typescript-eslint/unbound-method": "error",
109
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
110
- "@typescript-eslint/prefer-ts-expect-error": "error",
111
- // Any-related TS rules are turned to warn to allow building "non-TS-native" packages w/ many occurrences of them
112
- "@typescript-eslint/no-unsafe-argument": ["warn"],
113
- "@typescript-eslint/no-unsafe-return": ["warn"],
114
- "@typescript-eslint/no-unsafe-call": ["warn"],
115
- "@typescript-eslint/no-unsafe-member-access": ["warn"],
116
- "@typescript-eslint/no-unsafe-assignment": ["warn"],
117
- },
118
- settings: {
119
- "import/parsers": {
120
- "@typescript-eslint/parser": [".ts", ".tsx"],
121
- },
122
- "import/resolver": {
123
- typescript: {
124
- alwaysTryTypes: true,
125
- },
126
- },
127
- },
128
- };