@will-stone/eslint-config 0.5.1 → 0.7.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
@@ -179,9 +179,7 @@ function base() {
179
179
  "camelcase": "error",
180
180
  // Write comments however you like
181
181
  "capitalized-comments": "off",
182
- // If a class method does not use this,
183
- // it can sometimes be made into a static function
184
- "class-methods-use-this": "error",
182
+ "class-methods-use-this": "off",
185
183
  // Measures the number of linearly independent paths through a program's
186
184
  // source code. Rubbish. Use your own judgement on complexity.
187
185
  "complexity": "off",
@@ -478,6 +476,7 @@ function base() {
478
476
  "no-nonoctal-decimal-escape": "error",
479
477
  // This rule disallows calling the Math, JSON, Reflect and Atomics objects as functions.
480
478
  "no-obj-calls": "error",
479
+ "no-object-constructor": "error",
481
480
  // the leading zero which identifies an octal literal has been a source of
482
481
  // confusion and error in JavaScript code, ECMAScript 5 deprecates the use
483
482
  // of octal numeric literals.
@@ -749,6 +748,7 @@ var GLOB_EXCLUDE = [
749
748
  "**/temp",
750
749
  "**/.vitepress/cache",
751
750
  "**/.nuxt",
751
+ "**/.next",
752
752
  "**/.vercel",
753
753
  "**/.changeset",
754
754
  "**/.idea",
@@ -773,13 +773,13 @@ function ignores() {
773
773
  }
774
774
 
775
775
  // src/configs/imports.ts
776
- var import_eslint_plugin_i = __toESM(require("eslint-plugin-i"), 1);
776
+ var pluginImport = __toESM(require("eslint-plugin-i"), 1);
777
777
  var import_eslint_plugin_simple_import_sort = __toESM(require("eslint-plugin-simple-import-sort"), 1);
778
778
  function imports() {
779
779
  return [
780
780
  {
781
781
  plugins: {
782
- "import": import_eslint_plugin_i.default,
782
+ "import": pluginImport,
783
783
  "simple-import-sort": import_eslint_plugin_simple_import_sort.default
784
784
  },
785
785
  rules: {
@@ -1245,26 +1245,9 @@ function react() {
1245
1245
  "react/jsx-props-no-multi-spaces": "off",
1246
1246
  "react/jsx-tag-spacing": "off",
1247
1247
  "react/jsx-wrap-multilines": "off",
1248
- // It is common to use these lifecycle methods without using "this".
1249
- "class-methods-use-this": [
1250
- "error",
1251
- {
1252
- exceptMethods: [
1253
- "render",
1254
- "getInitialState",
1255
- "getDefaultProps",
1256
- "getChildContext",
1257
- "componentWillMount",
1258
- "componentDidMount",
1259
- "componentWillReceiveProps",
1260
- "shouldComponentUpdate",
1261
- "componentWillUpdate",
1262
- "componentDidUpdate",
1263
- "componentWillUnmount",
1264
- "componentDidCatch"
1265
- ]
1266
- }
1267
- ],
1248
+ /**
1249
+ * React
1250
+ */
1268
1251
  "react/boolean-prop-naming": "error",
1269
1252
  "react/button-has-type": "error",
1270
1253
  "react/default-props-match-prop-types": "error",
@@ -1380,6 +1363,9 @@ function react() {
1380
1363
  "react/static-property-placement": "error",
1381
1364
  "react/style-prop-object": "error",
1382
1365
  "react/void-dom-elements-no-children": "error",
1366
+ /**
1367
+ * Hooks
1368
+ */
1383
1369
  // Checks effect dependencies
1384
1370
  "react-hooks/exhaustive-deps": "warn",
1385
1371
  // Checks rules of Hooks
@@ -1575,6 +1561,7 @@ function typescript() {
1575
1561
  /**
1576
1562
  * Superseded by TS rules below
1577
1563
  */
1564
+ "class-methods-use-this": "off",
1578
1565
  "default-param-last": "off",
1579
1566
  "lines-between-class-members": "off",
1580
1567
  "no-duplicate-imports": "off",
@@ -1598,6 +1585,7 @@ function typescript() {
1598
1585
  "@typescript-eslint/ban-tslint-comment": "warn",
1599
1586
  // Ensures that literals on classes are exposed in a consistent style
1600
1587
  "@typescript-eslint/class-literal-property-style": "warn",
1588
+ "@typescript-eslint/class-methods-use-this": "off",
1601
1589
  // https://typescript-eslint.io/rules/consistent-generic-constructors/
1602
1590
  "@typescript-eslint/consistent-generic-constructors": "warn",
1603
1591
  // Enforce the use of the record type
package/dist/index.js CHANGED
@@ -143,9 +143,7 @@ function base() {
143
143
  "camelcase": "error",
144
144
  // Write comments however you like
145
145
  "capitalized-comments": "off",
146
- // If a class method does not use this,
147
- // it can sometimes be made into a static function
148
- "class-methods-use-this": "error",
146
+ "class-methods-use-this": "off",
149
147
  // Measures the number of linearly independent paths through a program's
150
148
  // source code. Rubbish. Use your own judgement on complexity.
151
149
  "complexity": "off",
@@ -442,6 +440,7 @@ function base() {
442
440
  "no-nonoctal-decimal-escape": "error",
443
441
  // This rule disallows calling the Math, JSON, Reflect and Atomics objects as functions.
444
442
  "no-obj-calls": "error",
443
+ "no-object-constructor": "error",
445
444
  // the leading zero which identifies an octal literal has been a source of
446
445
  // confusion and error in JavaScript code, ECMAScript 5 deprecates the use
447
446
  // of octal numeric literals.
@@ -713,6 +712,7 @@ var GLOB_EXCLUDE = [
713
712
  "**/temp",
714
713
  "**/.vitepress/cache",
715
714
  "**/.nuxt",
715
+ "**/.next",
716
716
  "**/.vercel",
717
717
  "**/.changeset",
718
718
  "**/.idea",
@@ -737,7 +737,7 @@ function ignores() {
737
737
  }
738
738
 
739
739
  // src/configs/imports.ts
740
- import pluginImport from "eslint-plugin-i";
740
+ import * as pluginImport from "eslint-plugin-i";
741
741
  import pluginSimpleImport from "eslint-plugin-simple-import-sort";
742
742
  function imports() {
743
743
  return [
@@ -1209,26 +1209,9 @@ function react() {
1209
1209
  "react/jsx-props-no-multi-spaces": "off",
1210
1210
  "react/jsx-tag-spacing": "off",
1211
1211
  "react/jsx-wrap-multilines": "off",
1212
- // It is common to use these lifecycle methods without using "this".
1213
- "class-methods-use-this": [
1214
- "error",
1215
- {
1216
- exceptMethods: [
1217
- "render",
1218
- "getInitialState",
1219
- "getDefaultProps",
1220
- "getChildContext",
1221
- "componentWillMount",
1222
- "componentDidMount",
1223
- "componentWillReceiveProps",
1224
- "shouldComponentUpdate",
1225
- "componentWillUpdate",
1226
- "componentDidUpdate",
1227
- "componentWillUnmount",
1228
- "componentDidCatch"
1229
- ]
1230
- }
1231
- ],
1212
+ /**
1213
+ * React
1214
+ */
1232
1215
  "react/boolean-prop-naming": "error",
1233
1216
  "react/button-has-type": "error",
1234
1217
  "react/default-props-match-prop-types": "error",
@@ -1344,6 +1327,9 @@ function react() {
1344
1327
  "react/static-property-placement": "error",
1345
1328
  "react/style-prop-object": "error",
1346
1329
  "react/void-dom-elements-no-children": "error",
1330
+ /**
1331
+ * Hooks
1332
+ */
1347
1333
  // Checks effect dependencies
1348
1334
  "react-hooks/exhaustive-deps": "warn",
1349
1335
  // Checks rules of Hooks
@@ -1539,6 +1525,7 @@ function typescript() {
1539
1525
  /**
1540
1526
  * Superseded by TS rules below
1541
1527
  */
1528
+ "class-methods-use-this": "off",
1542
1529
  "default-param-last": "off",
1543
1530
  "lines-between-class-members": "off",
1544
1531
  "no-duplicate-imports": "off",
@@ -1562,6 +1549,7 @@ function typescript() {
1562
1549
  "@typescript-eslint/ban-tslint-comment": "warn",
1563
1550
  // Ensures that literals on classes are exposed in a consistent style
1564
1551
  "@typescript-eslint/class-literal-property-style": "warn",
1552
+ "@typescript-eslint/class-methods-use-this": "off",
1565
1553
  // https://typescript-eslint.io/rules/consistent-generic-constructors/
1566
1554
  "@typescript-eslint/consistent-generic-constructors": "warn",
1567
1555
  // Enforce the use of the record type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@will-stone/eslint-config",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "Will Stone's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -72,7 +72,7 @@
72
72
  "@types/node": "^20.8.2",
73
73
  "@will-stone/prettier-config": "^7.0.1",
74
74
  "eslint": "^8.50.0",
75
- "eslint-flat-config-viewer": "^0.0.8",
75
+ "eslint-flat-config-viewer": "^0.0.9",
76
76
  "husky": "^8.0.3",
77
77
  "lint-staged": "^14.0.1",
78
78
  "prettier": "^3.0.3",