@ivanmaxlogiudice/eslint-config 1.0.0-beta.2 → 1.0.0-beta.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/README.md CHANGED
@@ -20,10 +20,9 @@ pnpm add -D @ivanmaxlogiudice/eslint-config
20
20
  ## Usage
21
21
  ```js
22
22
  // eslint.config.js
23
- import { defineFlatConfig } from 'eslint-define-config'
24
23
  import { all } from '@ivanmaxlogiudice/eslint-config'
25
24
 
26
- export default defineFlatConfig(all)
25
+ export default all
27
26
  ```
28
27
 
29
28
  ### Custom Config
@@ -40,6 +39,68 @@ export default config(
40
39
  )
41
40
  ```
42
41
 
42
+ ### VSCode
43
+
44
+ ```jsonc
45
+ {
46
+ "eslint.experimental.useFlatConfig": true
47
+ }
48
+ ```
49
+
50
+ ### VSCode support for auto fix
51
+ Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
52
+
53
+ Add the following settings to your `settings.json`:
54
+
55
+ ```jsonc
56
+ {
57
+ "prettier.enable": false,
58
+ "editor.formatOnSave": false,
59
+ "editor.codeActionsOnSave": {
60
+ "source.fixAll.eslint": true,
61
+ "source.organizeImports": false,
62
+
63
+ // The following is optional.
64
+ // It's better to put under project setting `.vscode/settings.json`
65
+ // to avoid conflicts with working with different eslint configs
66
+ // that does not support all formats.
67
+ "eslint.validate": [
68
+ "javascript",
69
+ "javascriptreact",
70
+ "typescript",
71
+ "typescriptreact",
72
+ "vue",
73
+ "html",
74
+ "markdown",
75
+ "json",
76
+ "jsonc",
77
+ "yaml"
78
+ ]
79
+ }
80
+ }
81
+ ```
82
+
83
+ ### Lint Staged
84
+
85
+ If you want to apply lint and auto-fix before every commit, you can add the following to your `package.json`:
86
+
87
+ ```json
88
+ {
89
+ "simple-git-hooks": {
90
+ "pre-commit": "pnpm lint-staged"
91
+ },
92
+ "lint-staged": {
93
+ "*": "eslint --fix"
94
+ }
95
+ }
96
+ ```
97
+
98
+ and then
99
+
100
+ ```bash
101
+ pnpm i -D lint-staged simple-git-hooks
102
+ ```
103
+
43
104
  ## License
44
105
 
45
106
  [MIT](./LICENSE) License © 2022-PRESENT [Iván M. Lo Giudice](https://github.com/ivanmaxlogiudice)
package/index.cjs CHANGED
@@ -407,6 +407,7 @@ var imports = [
407
407
  }],
408
408
  pathGroupsExcludedImportTypes: ["type"]
409
409
  }],
410
+ "import/no-self-import": "error",
410
411
  // off
411
412
  "import/namespace": "off",
412
413
  "import/no-absolute-path": "off",
@@ -743,11 +744,11 @@ var typescript = [
743
744
  "antfu/generic-spacing": "error",
744
745
  "antfu/no-cjs-exports": "error",
745
746
  "antfu/no-ts-export-equal": "error",
747
+ "antfu/no-const-enum": "error",
746
748
  // off
747
749
  "import/named": "off",
748
750
  "@typescript-eslint/no-unused-vars": "off",
749
751
  // handled by unused-imports/no-unused-imports
750
- "@typescript-eslint/ban-types": "off",
751
752
  "@typescript-eslint/no-explicit-any": "off",
752
753
  "@typescript-eslint/no-non-null-assertion": "off",
753
754
  "@typescript-eslint/explicit-module-boundary-types": "off",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ivanmaxlogiudice/eslint-config",
3
- "version": "1.0.0-beta.2",
4
- "packageManager": "pnpm@8.6.2",
3
+ "version": "1.0.0-beta.3",
4
+ "packageManager": "pnpm@8.6.6",
5
5
  "description": "Personal ESLint config",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -31,14 +31,14 @@
31
31
  "eslint": "^8.0.0"
32
32
  },
33
33
  "dependencies": {
34
- "@eslint/js": "^8.43.0",
35
- "@typescript-eslint/eslint-plugin": "^5.60.0",
36
- "@typescript-eslint/parser": "^5.60.0",
34
+ "@eslint/js": "^8.44.0",
35
+ "@typescript-eslint/eslint-plugin": "^5.61.0",
36
+ "@typescript-eslint/parser": "^5.61.0",
37
37
  "eslint-config-standard": "^17.1.0",
38
38
  "eslint-define-config": "^1.21.0",
39
- "eslint-plugin-antfu": "^0.39.5",
39
+ "eslint-plugin-antfu": "^0.39.7",
40
40
  "eslint-plugin-eslint-comments": "^3.2.0",
41
- "eslint-plugin-import": "^2.27.5",
41
+ "eslint-plugin-import": "npm:eslint-plugin-i@2.27.5-4",
42
42
  "eslint-plugin-jsonc": "^2.9.0",
43
43
  "eslint-plugin-markdown": "^3.0.0",
44
44
  "eslint-plugin-n": "^16.0.1",
@@ -54,11 +54,11 @@
54
54
  "yaml-eslint-parser": "^1.2.2"
55
55
  },
56
56
  "devDependencies": {
57
- "@types/node": "^20.3.1",
57
+ "@types/node": "^20.4.1",
58
58
  "bumpp": "^9.1.1",
59
- "eslint": "^8.43.0",
59
+ "eslint": "^8.44.0",
60
60
  "tsup": "^7.1.0",
61
- "typescript": "^5.1.3"
61
+ "typescript": "^5.1.6"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=16.14.0"
package/src/js.js CHANGED
@@ -244,6 +244,7 @@ export const imports = [
244
244
  }],
245
245
  pathGroupsExcludedImportTypes: ['type'],
246
246
  }],
247
+ 'import/no-self-import': 'error',
247
248
 
248
249
  // off
249
250
  'import/namespace': 'off',
package/src/typescript.js CHANGED
@@ -114,12 +114,12 @@ export const typescript = [
114
114
  'antfu/generic-spacing': 'error',
115
115
  'antfu/no-cjs-exports': 'error',
116
116
  'antfu/no-ts-export-equal': 'error',
117
+ 'antfu/no-const-enum': 'error',
117
118
 
118
119
  // off
119
120
  'import/named': 'off',
120
121
 
121
122
  '@typescript-eslint/no-unused-vars': 'off', // handled by unused-imports/no-unused-imports
122
- '@typescript-eslint/ban-types': 'off',
123
123
  '@typescript-eslint/no-explicit-any': 'off',
124
124
  '@typescript-eslint/no-non-null-assertion': 'off',
125
125
  '@typescript-eslint/explicit-module-boundary-types': 'off',