@luxass/eslint-config 4.8.2 → 4.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/dist/index.cjs CHANGED
@@ -1172,22 +1172,24 @@ async function typescript(options = {}) {
1172
1172
  const typeAwareRules = {
1173
1173
  "dot-notation": "off",
1174
1174
  "no-implied-eval": "off",
1175
- "no-throw-literal": "off",
1176
1175
  "ts/await-thenable": "error",
1177
1176
  "ts/dot-notation": ["error", { allowKeywords: true }],
1178
1177
  "ts/no-floating-promises": "error",
1179
1178
  "ts/no-for-in-array": "error",
1180
1179
  "ts/no-implied-eval": "error",
1181
1180
  "ts/no-misused-promises": "error",
1182
- "ts/no-throw-literal": "error",
1183
1181
  "ts/no-unnecessary-type-assertion": "error",
1184
1182
  "ts/no-unsafe-argument": "error",
1185
1183
  "ts/no-unsafe-assignment": "error",
1186
1184
  "ts/no-unsafe-call": "error",
1187
1185
  "ts/no-unsafe-member-access": "error",
1188
1186
  "ts/no-unsafe-return": "error",
1187
+ "ts/promise-function-async": "error",
1189
1188
  "ts/restrict-plus-operands": "error",
1190
1189
  "ts/restrict-template-expressions": "error",
1190
+ "ts/return-await": ["error", "in-try-catch"],
1191
+ "ts/strict-boolean-expressions": ["error", { allowNullableBoolean: true, allowNullableObject: true }],
1192
+ "ts/switch-exhaustiveness-check": "error",
1191
1193
  "ts/unbound-method": "error"
1192
1194
  };
1193
1195
  const [
@@ -1208,7 +1210,10 @@ async function typescript(options = {}) {
1208
1210
  extraFileExtensions: exts.map((ext) => `.${ext}`),
1209
1211
  sourceType: "module",
1210
1212
  ...typeAware ? {
1211
- project: tsconfigPath,
1213
+ projectService: {
1214
+ allowDefaultProject: ["./*.js"],
1215
+ defaultProject: tsconfigPath
1216
+ },
1212
1217
  tsconfigRootDir: import_node_process2.default.cwd()
1213
1218
  } : {},
1214
1219
  ...parserOptions
@@ -1245,48 +1250,17 @@ async function typescript(options = {}) {
1245
1250
  ),
1246
1251
  "no-dupe-class-members": "off",
1247
1252
  "no-invalid-this": "off",
1248
- "no-loss-of-precision": "off",
1253
+ "no-loss-of-precision": "error",
1249
1254
  "no-redeclare": "off",
1250
1255
  "no-use-before-define": "off",
1251
1256
  "no-useless-constructor": "off",
1252
1257
  "ts/ban-ts-comment": [
1253
1258
  "error",
1254
- { "ts-ignore": "allow-with-description" }
1255
- ],
1256
- "ts/ban-types": ["error", {
1257
- extendDefaults: false,
1258
- types: {
1259
- BigInt: {
1260
- fixWith: "bigint",
1261
- message: "Use `bigint` instead."
1262
- },
1263
- Boolean: {
1264
- fixWith: "boolean",
1265
- message: "Use `boolean` instead."
1266
- },
1267
- Function: "Use a specific function type instead, like `() => void`.",
1268
- Number: {
1269
- fixWith: "number",
1270
- message: "Use `number` instead."
1271
- },
1272
- Object: {
1273
- fixWith: "Record<string, unknown>",
1274
- message: "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848"
1275
- },
1276
- String: {
1277
- fixWith: "string",
1278
- message: "Use `string` instead."
1279
- },
1280
- Symbol: {
1281
- fixWith: "symbol",
1282
- message: "Use `symbol` instead."
1283
- },
1284
- object: {
1285
- fixWith: "Record<string, unknown>",
1286
- message: "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848"
1287
- }
1259
+ {
1260
+ "ts-ignore": "allow-with-description",
1261
+ "ts-expect-error": "allow-with-description"
1288
1262
  }
1289
- }],
1263
+ ],
1290
1264
  "ts/consistent-type-definitions": ["error", "interface"],
1291
1265
  "ts/consistent-type-imports": [
1292
1266
  "error",
@@ -1296,12 +1270,12 @@ async function typescript(options = {}) {
1296
1270
  // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
1297
1271
  "ts/no-dupe-class-members": "error",
1298
1272
  "ts/no-dynamic-delete": "off",
1273
+ "ts/no-empty-object-type": "error",
1299
1274
  "ts/no-explicit-any": "off",
1300
1275
  "ts/no-extraneous-class": "off",
1301
1276
  "ts/no-import-type-side-effects": "error",
1302
1277
  "ts/no-invalid-this": "error",
1303
1278
  "ts/no-invalid-void-type": "off",
1304
- "ts/no-loss-of-precision": "error",
1305
1279
  "ts/no-non-null-assertion": "off",
1306
1280
  "ts/no-redeclare": "error",
1307
1281
  "ts/no-require-imports": "error",
@@ -1311,7 +1285,7 @@ async function typescript(options = {}) {
1311
1285
  { classes: false, functions: false, variables: true }
1312
1286
  ],
1313
1287
  "ts/no-useless-constructor": "off",
1314
- "ts/prefer-ts-expect-error": "error",
1288
+ "ts/no-wrapper-object-types": "error",
1315
1289
  "ts/triple-slash-reference": "off",
1316
1290
  "ts/unified-signatures": "off",
1317
1291
  ...overrides