@medplum/eslint-config 2.0.26

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/index.cjs +157 -0
  2. package/package.json +35 -0
package/index.cjs ADDED
@@ -0,0 +1,157 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ plugins: ['@typescript-eslint'],
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:@typescript-eslint/strict',
8
+ 'plugin:jsdoc/recommended-typescript-error',
9
+ 'plugin:prettier/recommended',
10
+ 'plugin:react-hooks/recommended',
11
+ ],
12
+ reportUnusedDisableDirectives: true,
13
+ rules: {
14
+ // ESLint - Possible Problems
15
+ 'array-callback-return': 'error',
16
+ curly: ['error', 'all'],
17
+ eqeqeq: ['error', 'always'],
18
+ 'no-constant-binary-expression': 'error',
19
+ 'no-constructor-return': 'error',
20
+ 'no-duplicate-imports': 'error',
21
+ 'no-new-native-nonconstructor': 'error',
22
+ 'no-promise-executor-return': 'error',
23
+ 'no-self-compare': 'error',
24
+ 'no-template-curly-in-string': 'error',
25
+ 'no-unmodified-loop-condition': 'error',
26
+ 'no-unreachable-loop': 'error',
27
+ 'no-unused-private-class-members': 'error',
28
+
29
+ // ESLint - Suggestions
30
+ 'consistent-return': 'error',
31
+ 'default-case-last': 'error',
32
+ 'default-param-last': 'error',
33
+ 'guard-for-in': 'error',
34
+ 'no-array-constructor': 'error',
35
+ 'no-div-regex': 'error',
36
+ 'no-eq-null': 'error',
37
+ 'no-eval': 'error',
38
+ 'no-extend-native': 'error',
39
+ 'no-extra-bind': 'error',
40
+ 'no-floating-decimal': 'error',
41
+ 'no-implied-eval': 'error',
42
+ 'no-invalid-this': 'error',
43
+ 'no-lonely-if': 'error',
44
+ 'no-nested-ternary': 'error',
45
+ 'no-new': 'error',
46
+ 'no-new-func': 'error',
47
+ 'no-new-object': 'error',
48
+ 'no-new-wrappers': 'error',
49
+ 'no-octal-escape': 'error',
50
+ 'no-proto': 'error',
51
+ 'no-return-assign': 'error',
52
+ 'no-return-await': 'error',
53
+ 'no-sequences': 'error',
54
+ 'no-unneeded-ternary': 'error',
55
+ 'no-unused-expressions': 'error',
56
+ 'no-useless-call': 'error',
57
+ 'no-useless-computed-key': 'error',
58
+ 'no-useless-concat': 'error',
59
+ 'no-useless-return': 'error',
60
+ 'no-var': 'error',
61
+ 'no-void': 'error',
62
+ 'prefer-object-has-own': 'error',
63
+ 'prefer-object-spread': 'error',
64
+ 'prefer-promise-reject-errors': 'error',
65
+ 'prefer-regex-literals': 'error',
66
+ 'prefer-rest-params': 'error',
67
+ 'prefer-spread': 'error',
68
+ radix: 'error',
69
+
70
+ // TypeScript+ESLint
71
+ '@typescript-eslint/array-type': 'error',
72
+ '@typescript-eslint/consistent-generic-constructors': 'error',
73
+ '@typescript-eslint/consistent-type-assertions': 'error',
74
+ '@typescript-eslint/explicit-function-return-type': [
75
+ 'error',
76
+ {
77
+ allowExpressions: true,
78
+ },
79
+ ],
80
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
81
+ '@typescript-eslint/no-base-to-string': 'error',
82
+ '@typescript-eslint/no-confusing-non-null-assertion': 'error',
83
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
84
+ '@typescript-eslint/no-duplicate-type-constituents': 'error',
85
+ '@typescript-eslint/no-explicit-any': 'off',
86
+ '@typescript-eslint/no-extraneous-class': 'error',
87
+ '@typescript-eslint/no-floating-promises': 'error',
88
+ '@typescript-eslint/no-invalid-void-type': 'error',
89
+ '@typescript-eslint/no-meaningless-void-operator': 'error',
90
+ '@typescript-eslint/no-mixed-enums': 'error',
91
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
92
+ '@typescript-eslint/no-redundant-type-constituents': 'error',
93
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
94
+ '@typescript-eslint/no-unnecessary-type-arguments': 'error',
95
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
96
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
97
+ '@typescript-eslint/prefer-for-of': 'error',
98
+ '@typescript-eslint/prefer-includes': 'error',
99
+ '@typescript-eslint/prefer-function-type': 'off', // Docusaurus doesn't play nice with function type style
100
+ '@typescript-eslint/prefer-literal-enum-member': 'error',
101
+ '@typescript-eslint/prefer-optional-chain': 'error',
102
+ '@typescript-eslint/prefer-reduce-type-parameter': 'error',
103
+ '@typescript-eslint/prefer-return-this-type': 'error',
104
+ '@typescript-eslint/prefer-string-starts-ends-with': 'error',
105
+ '@typescript-eslint/prefer-ts-expect-error': 'off', // We must use @ts-ignore for optional dependencies in type definitions
106
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
107
+ '@typescript-eslint/unified-signatures': 'error',
108
+ // TypeScript extensions for base rules
109
+ 'no-throw-literal': 'off',
110
+ '@typescript-eslint/no-throw-literal': 'error',
111
+
112
+ 'no-useless-constructor': 'off',
113
+ '@typescript-eslint/no-useless-constructor': 'error',
114
+
115
+ 'no-unused-vars': 'off',
116
+ '@typescript-eslint/no-unused-vars': [
117
+ 'error',
118
+ {
119
+ argsIgnorePattern: '^_',
120
+ varsIgnorePattern: '^_',
121
+ },
122
+ ],
123
+
124
+ // Disable warnings from typescript-eslint:strict
125
+ '@typescript-eslint/non-nullable-type-assertion-style': 'off',
126
+ '@typescript-eslint/dot-notation': 'off',
127
+ '@typescript-eslint/consistent-indexed-object-style': 'off',
128
+ '@typescript-eslint/consistent-type-definitions': 'off',
129
+ '@typescript-eslint/prefer-nullish-coalescing': 'off',
130
+ '@typescript-eslint/no-unnecessary-condition': 'off',
131
+ '@typescript-eslint/no-dynamic-delete': 'off',
132
+
133
+ // JSDoc
134
+ 'jsdoc/check-tag-names': [
135
+ 'error',
136
+ {
137
+ definedTags: ['category', 'experimental', 'ts-ignore'],
138
+ },
139
+ ],
140
+ 'jsdoc/require-jsdoc': 'off',
141
+ 'jsdoc/tag-lines': 'off',
142
+ },
143
+ ignorePatterns: [
144
+ 'coverage',
145
+ 'dist',
146
+ 'node_modules',
147
+ 'packages/**/dist/',
148
+ 'packages/docs/build/',
149
+ 'packages/docs/docusaurus.config.js',
150
+ 'packages/docs/sidebars.js',
151
+ 'babel.config.js',
152
+ 'jest.sequencer.js',
153
+ 'package-lock.json',
154
+ 'rollup.config.mjs',
155
+ 'webpack.config.js',
156
+ ],
157
+ };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@medplum/eslint-config",
3
+ "version": "2.0.26",
4
+ "description": "Shared ESLint configuration for Medplum projects",
5
+ "main": "index.cjs",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/medplum/medplum.git",
9
+ "directory": "packages/eslint-config"
10
+ },
11
+ "author": "Medplum <hello@medplum.com>",
12
+ "license": "Apache-2.0",
13
+ "bugs": {
14
+ "url": "https://github.com/medplum/medplum/issues"
15
+ },
16
+ "homepage": "https://github.com/medplum/medplum#readme",
17
+ "keywords": [
18
+ "eslint",
19
+ "eslintconfig"
20
+ ],
21
+ "engines": {
22
+ "node": ">=18.0.0"
23
+ },
24
+ "peerDependencies": {
25
+ "@typescript-eslint/eslint-plugin": ">=5",
26
+ "eslint": ">=8",
27
+ "eslint-plugin-jsdoc": ">=46",
28
+ "eslint-plugin-prettier": ">=4",
29
+ "eslint-plugin-react-hooks": ">=4"
30
+ },
31
+ "dependencies": {
32
+ "@typescript-eslint/parser": "5.60.1",
33
+ "eslint-config-prettier": "8.8.0"
34
+ }
35
+ }