@danielwaltz/eslint-config 0.0.2 → 0.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+
4
+ ## v0.0.3
5
+
6
+ [compare changes](https://github.com/danielwaltz/eslint-config/compare/v0.0.2...v0.0.3)
7
+
8
+ ### 🚀 Enhancements
9
+
10
+ - Add import configs ([3990a67](https://github.com/danielwaltz/eslint-config/commit/3990a67))
11
+
12
+ ### 🩹 Fixes
13
+
14
+ - Use warn level for prettier rule ([ce9e60c](https://github.com/danielwaltz/eslint-config/commit/ce9e60c))
15
+
16
+ ### 📖 Documentation
17
+
18
+ - Add readme ([3dce66a](https://github.com/danielwaltz/eslint-config/commit/3dce66a))
19
+
20
+ ### 🏡 Chore
21
+
22
+ - Include readme and changelog in dist ([1c29ead](https://github.com/danielwaltz/eslint-config/commit/1c29ead))
23
+ - Split test and release scripts ([84b0646](https://github.com/danielwaltz/eslint-config/commit/84b0646))
24
+
25
+ ### ❤️ Contributors
26
+
27
+ - Daniel Waltz ([@danielwaltz](http://github.com/danielwaltz))
28
+
29
+ ## v0.0.2
30
+
31
+
32
+ ### 🚀 Enhancements
33
+
34
+ - Initial config ([2307e38](https://github.com/danielwaltz/eslint-config/commit/2307e38))
35
+ - Enable typescript and javascript plugins using recommended rules ([f5a3113](https://github.com/danielwaltz/eslint-config/commit/f5a3113))
36
+
37
+ ### 🏡 Chore
38
+
39
+ - Init ([590fe61](https://github.com/danielwaltz/eslint-config/commit/590fe61))
40
+ - Update config names ([9a857da](https://github.com/danielwaltz/eslint-config/commit/9a857da))
41
+ - Update release script ([30cf611](https://github.com/danielwaltz/eslint-config/commit/30cf611))
42
+
43
+ ### ❤️ Contributors
44
+
45
+ - Daniel Waltz ([@danielwaltz](http://github.com/danielwaltz))
46
+
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # @danielwaltz/eslint-config
2
+
3
+ My personal ESLint configuration.
4
+
5
+ ## Installation
6
+
7
+ ```shell
8
+ npx -y nypm@latest i -D @danielwaltz/eslint-config
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```mjs
14
+ import { danielwaltz } from "@danielwaltz/eslint-config";
15
+
16
+ export default danielwaltz();
17
+ ```
18
+
19
+ ## Customization
20
+
21
+ ```mjs
22
+ import { danielwaltz } from "@danielwaltz/eslint-config";
23
+
24
+ export default danielwaltz([...customRules])
25
+ .prepend([...prependRules])
26
+ .append([...appendRules]);
27
+ ```
package/dist/index.mjs CHANGED
@@ -1,9 +1,20 @@
1
1
  import prettier from 'eslint-plugin-prettier/recommended';
2
- import { composer } from 'eslint-flat-config-utils';
2
+ import importPlugin from 'eslint-plugin-import-x';
3
3
  import eslint from '@eslint/js';
4
4
  import tseslint from 'typescript-eslint';
5
+ import { composer } from 'eslint-flat-config-utils';
5
6
 
6
- function global() {
7
+ function formattingConfigs() {
8
+ return [
9
+ prettier,
10
+ {
11
+ rules: { "prettier/prettier": "warn" },
12
+ name: "danielwaltz/formatting/customized"
13
+ }
14
+ ];
15
+ }
16
+
17
+ function globalConfigs() {
7
18
  return [
8
19
  {
9
20
  ignores: [
@@ -21,20 +32,35 @@ function global() {
21
32
  ];
22
33
  }
23
34
 
24
- function formatting() {
35
+ function importConfigs() {
25
36
  return [
37
+ importPlugin.flatConfigs.recommended,
38
+ importPlugin.flatConfigs.typescript,
26
39
  {
27
- ...prettier,
28
- name: "danielwaltz/formatting/prettier"
40
+ files: ["**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,d.ts,vue}"],
41
+ rules: {
42
+ "import-x/no-unresolved": ["error", { ignore: ["\\?*$"] }],
43
+ "import-x/order": [
44
+ "warn",
45
+ {
46
+ groups: [
47
+ "builtin",
48
+ "external",
49
+ "internal",
50
+ "parent",
51
+ "sibling",
52
+ "index"
53
+ ],
54
+ alphabetize: { order: "asc", caseInsensitive: false }
55
+ }
56
+ ]
57
+ },
58
+ name: "danielwaltz/import/customized"
29
59
  }
30
60
  ];
31
61
  }
32
62
 
33
- function defineFlatConfigs(...configs) {
34
- return composer(...configs);
35
- }
36
-
37
- function typescript() {
63
+ function typescriptConfigs() {
38
64
  return tseslint.config(
39
65
  eslint.configs.recommended,
40
66
  tseslint.configs.recommendedTypeChecked,
@@ -67,11 +93,16 @@ function typescript() {
67
93
  );
68
94
  }
69
95
 
96
+ function defineFlatConfigs(...configs) {
97
+ return composer(...configs);
98
+ }
99
+
70
100
  async function danielwaltz(...userConfigs) {
71
101
  const composer = defineFlatConfigs(...userConfigs);
72
- await composer.prepend(global());
73
- await composer.append(typescript());
74
- await composer.append(formatting());
102
+ await composer.prepend(globalConfigs());
103
+ await composer.append(typescriptConfigs());
104
+ await composer.append(importConfigs());
105
+ await composer.append(formattingConfigs());
75
106
  return composer;
76
107
  }
77
108
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielwaltz/eslint-config",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "author": "Daniel Waltz",
6
6
  "repository": {
@@ -19,7 +19,9 @@
19
19
  }
20
20
  },
21
21
  "files": [
22
- "dist"
22
+ "dist",
23
+ "README.md",
24
+ "CHANGELOG.md"
23
25
  ],
24
26
  "packageManager": "pnpm@9.15.0",
25
27
  "scripts": {
@@ -28,7 +30,8 @@
28
30
  "lint": "eslint .",
29
31
  "type-check": "tsc --noEmit",
30
32
  "prepack": "pnpm build",
31
- "release": "pnpm prepack && pnpx publint@latest && pnpx @arethetypeswrong/cli@latest --pack --profile esm-only && changelogen --release --push --publish && changelogen gh release"
33
+ "test": "pnpm prepack && pnpm lint && pnpm type-check && pnpx publint@latest && pnpx @arethetypeswrong/cli@latest --pack --profile esm-only",
34
+ "release": "pnpm test && changelogen --release --push --publish && changelogen gh release"
32
35
  },
33
36
  "peerDependencies": {
34
37
  "eslint": ">=9",
@@ -38,6 +41,8 @@
38
41
  "@eslint/js": "^9.16.0",
39
42
  "eslint-config-prettier": "^9.1.0",
40
43
  "eslint-flat-config-utils": "^0.4.0",
44
+ "eslint-import-resolver-typescript": "^3.7.0",
45
+ "eslint-plugin-import-x": "^4.5.0",
41
46
  "eslint-plugin-prettier": "^5.2.1",
42
47
  "typescript-eslint": "^8.17.0"
43
48
  },