@coderwyd/eslint-config 2.1.2 → 2.1.3

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/cli.cjs CHANGED
@@ -46,7 +46,7 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
46
46
  var import_picocolors = __toESM(require("picocolors"), 1);
47
47
 
48
48
  // package.json
49
- var version = "2.1.2";
49
+ var version = "2.1.3";
50
50
  var devDependencies = {
51
51
  "@antfu/ni": "^0.21.12",
52
52
  "@types/eslint": "^8.56.2",
package/dist/cli.js CHANGED
@@ -17,7 +17,7 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.1.2";
20
+ var version = "2.1.3";
21
21
  var devDependencies = {
22
22
  "@antfu/ni": "^0.21.12",
23
23
  "@types/eslint": "^8.56.2",
package/dist/index.cjs CHANGED
@@ -987,31 +987,64 @@ async function unicorn() {
987
987
  },
988
988
  rules: {
989
989
  "unicorn/better-regex": "error",
990
- // Pass error message when throwing errors
990
+ "unicorn/catch-error-name": "error",
991
+ "unicorn/custom-error-definition": "error",
991
992
  "unicorn/error-message": "error",
992
- // Uppercase regex escapes
993
993
  "unicorn/escape-case": "error",
994
- // Array.isArray instead of instanceof
994
+ "unicorn/explicit-length-check": "error",
995
+ // 'unicorn/filename-case': [
996
+ // 'error',
997
+ // {
998
+ // cases: { kebabCase: true, pascalCase: true },
999
+ // ignore: [/^[A-Z]+\..*$/],
1000
+ // },
1001
+ // ],
1002
+ "unicorn/new-for-builtins": "error",
1003
+ "unicorn/no-array-callback-reference": "error",
1004
+ "unicorn/no-array-method-this-argument": "error",
1005
+ "unicorn/no-array-push-push": "error",
1006
+ "unicorn/no-console-spaces": "error",
1007
+ "unicorn/no-for-loop": "error",
1008
+ "unicorn/no-hex-escape": "error",
995
1009
  "unicorn/no-instanceof-array": "error",
996
- // Ban `new Array` as `Array` constructor's params are ambiguous
1010
+ "unicorn/no-invalid-remove-event-listener": "error",
1011
+ "unicorn/no-lonely-if": "error",
997
1012
  "unicorn/no-new-array": "error",
998
- // Prevent deprecated `new Buffer()`
999
1013
  "unicorn/no-new-buffer": "error",
1000
- // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
1001
- "unicorn/number-literal-case": "error",
1002
- // textContent instead of innerText
1014
+ "unicorn/no-static-only-class": "error",
1015
+ "unicorn/no-unnecessary-await": "error",
1016
+ "unicorn/no-zero-fractions": `error`,
1017
+ "unicorn/prefer-add-event-listener": "error",
1018
+ "unicorn/prefer-array-find": "error",
1019
+ "unicorn/prefer-array-flat-map": "error",
1020
+ "unicorn/prefer-array-index-of": "error",
1021
+ "unicorn/prefer-array-some": "error",
1022
+ "unicorn/prefer-at": "error",
1023
+ "unicorn/prefer-blob-reading-methods": "error",
1024
+ "unicorn/prefer-date-now": "error",
1025
+ "unicorn/prefer-dom-node-append": "error",
1026
+ "unicorn/prefer-dom-node-dataset": "error",
1027
+ "unicorn/prefer-dom-node-remove": "error",
1003
1028
  "unicorn/prefer-dom-node-text-content": "error",
1004
- // includes over indexOf when checking for existence
1005
1029
  "unicorn/prefer-includes": "error",
1006
- // Prefer using the node: protocol
1030
+ "unicorn/prefer-keyboard-event-key": "error",
1031
+ "unicorn/prefer-math-trunc": "error",
1032
+ "unicorn/prefer-modern-dom-apis": "error",
1033
+ "unicorn/prefer-modern-math-apis": "error",
1034
+ "unicorn/prefer-negative-index": "error",
1007
1035
  "unicorn/prefer-node-protocol": "error",
1008
- // Prefer using number properties like `Number.isNaN` rather than `isNaN`
1009
1036
  "unicorn/prefer-number-properties": "error",
1010
- // String methods startsWith/endsWith instead of more complicated stuff
1037
+ "unicorn/prefer-optional-catch-binding": "error",
1038
+ "unicorn/prefer-prototype-methods": "error",
1039
+ "unicorn/prefer-query-selector": "error",
1040
+ "unicorn/prefer-reflect-apply": "error",
1041
+ "unicorn/prefer-regexp-test": "error",
1042
+ "unicorn/prefer-string-replace-all": "error",
1043
+ "unicorn/prefer-string-slice": "error",
1011
1044
  "unicorn/prefer-string-starts-ends-with": "error",
1012
- // Enforce throwing type error when throwing error while checking typeof
1045
+ "unicorn/prefer-string-trim-start-end": "error",
1046
+ "unicorn/prefer-top-level-await": "error",
1013
1047
  "unicorn/prefer-type-error": "error",
1014
- // Use new when throwing error
1015
1048
  "unicorn/throw-new-error": "error"
1016
1049
  }
1017
1050
  }
package/dist/index.js CHANGED
@@ -953,31 +953,64 @@ async function unicorn() {
953
953
  },
954
954
  rules: {
955
955
  "unicorn/better-regex": "error",
956
- // Pass error message when throwing errors
956
+ "unicorn/catch-error-name": "error",
957
+ "unicorn/custom-error-definition": "error",
957
958
  "unicorn/error-message": "error",
958
- // Uppercase regex escapes
959
959
  "unicorn/escape-case": "error",
960
- // Array.isArray instead of instanceof
960
+ "unicorn/explicit-length-check": "error",
961
+ // 'unicorn/filename-case': [
962
+ // 'error',
963
+ // {
964
+ // cases: { kebabCase: true, pascalCase: true },
965
+ // ignore: [/^[A-Z]+\..*$/],
966
+ // },
967
+ // ],
968
+ "unicorn/new-for-builtins": "error",
969
+ "unicorn/no-array-callback-reference": "error",
970
+ "unicorn/no-array-method-this-argument": "error",
971
+ "unicorn/no-array-push-push": "error",
972
+ "unicorn/no-console-spaces": "error",
973
+ "unicorn/no-for-loop": "error",
974
+ "unicorn/no-hex-escape": "error",
961
975
  "unicorn/no-instanceof-array": "error",
962
- // Ban `new Array` as `Array` constructor's params are ambiguous
976
+ "unicorn/no-invalid-remove-event-listener": "error",
977
+ "unicorn/no-lonely-if": "error",
963
978
  "unicorn/no-new-array": "error",
964
- // Prevent deprecated `new Buffer()`
965
979
  "unicorn/no-new-buffer": "error",
966
- // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
967
- "unicorn/number-literal-case": "error",
968
- // textContent instead of innerText
980
+ "unicorn/no-static-only-class": "error",
981
+ "unicorn/no-unnecessary-await": "error",
982
+ "unicorn/no-zero-fractions": `error`,
983
+ "unicorn/prefer-add-event-listener": "error",
984
+ "unicorn/prefer-array-find": "error",
985
+ "unicorn/prefer-array-flat-map": "error",
986
+ "unicorn/prefer-array-index-of": "error",
987
+ "unicorn/prefer-array-some": "error",
988
+ "unicorn/prefer-at": "error",
989
+ "unicorn/prefer-blob-reading-methods": "error",
990
+ "unicorn/prefer-date-now": "error",
991
+ "unicorn/prefer-dom-node-append": "error",
992
+ "unicorn/prefer-dom-node-dataset": "error",
993
+ "unicorn/prefer-dom-node-remove": "error",
969
994
  "unicorn/prefer-dom-node-text-content": "error",
970
- // includes over indexOf when checking for existence
971
995
  "unicorn/prefer-includes": "error",
972
- // Prefer using the node: protocol
996
+ "unicorn/prefer-keyboard-event-key": "error",
997
+ "unicorn/prefer-math-trunc": "error",
998
+ "unicorn/prefer-modern-dom-apis": "error",
999
+ "unicorn/prefer-modern-math-apis": "error",
1000
+ "unicorn/prefer-negative-index": "error",
973
1001
  "unicorn/prefer-node-protocol": "error",
974
- // Prefer using number properties like `Number.isNaN` rather than `isNaN`
975
1002
  "unicorn/prefer-number-properties": "error",
976
- // String methods startsWith/endsWith instead of more complicated stuff
1003
+ "unicorn/prefer-optional-catch-binding": "error",
1004
+ "unicorn/prefer-prototype-methods": "error",
1005
+ "unicorn/prefer-query-selector": "error",
1006
+ "unicorn/prefer-reflect-apply": "error",
1007
+ "unicorn/prefer-regexp-test": "error",
1008
+ "unicorn/prefer-string-replace-all": "error",
1009
+ "unicorn/prefer-string-slice": "error",
977
1010
  "unicorn/prefer-string-starts-ends-with": "error",
978
- // Enforce throwing type error when throwing error while checking typeof
1011
+ "unicorn/prefer-string-trim-start-end": "error",
1012
+ "unicorn/prefer-top-level-await": "error",
979
1013
  "unicorn/prefer-type-error": "error",
980
- // Use new when throwing error
981
1014
  "unicorn/throw-new-error": "error"
982
1015
  }
983
1016
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "2.1.2",
4
+ "version": "2.1.3",
5
5
  "packageManager": "pnpm@8.15.1",
6
6
  "description": "Donny's ESLint config",
7
7
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",