@phaicom/eslint-config 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +102 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,27 +1,116 @@
1
1
  # `@phaicom/eslint-config`
2
2
 
3
- phaicom's ESLint configuration.
3
+ Personal ESLint configuration preset.
4
4
 
5
- - Based on [antfu/eslint-config](https://github.com/antfu/eslint-config).
6
- - Enable all unicorn config.
7
- - Forced to always use curly.
8
- - Modified rules including unicorn, stylistic, Vue, etc.
9
- - Integrated with [eslint-plugin-readable-tailwind](https://github.com/schoero/eslint-plugin-readable-tailwind).
5
+ Features:
6
+ - Built on [antfu/eslint-config](https://github.com/antfu/eslint-config)
7
+ - Enforces curly brackets for all blocks
8
+ - Custom rule sets for unicorn, stylistic, and Vue
9
+ - Tailwind support with [eslint-plugin-readable-tailwind](https://github.com/schoero/eslint-plugin-readable-tailwind)
10
10
 
11
- ## Usage with tailwind
12
- Start by install **eslint-plugin-readable-tailwind**
11
+ ## Usage
13
12
 
13
+ 1. Install the package:
14
14
  ```bash
15
- pnpm install -D eslint-plugin-readable-tailwind@beta
15
+ pnpm i -D @phaicom/eslint-config
16
16
  ```
17
17
 
18
- And set the **tailwind** flag to true.
18
+ 2. Create `eslint.config.mjs` in your project root:
19
+ ```js
20
+ // eslint.config.mjs
21
+ import configs from '@phaicom/eslint-config'
22
+
23
+ export default configs()
24
+ ```
25
+
26
+ 3. Configure VS Code:
27
+ - Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
28
+ - Add the following settings to `.vscode/settings.json`:
29
+
30
+ ```jsonc
31
+ {
32
+ // Disable the default formatter, use eslint instead
33
+ "prettier.enable": false,
34
+ "editor.formatOnSave": false,
35
+
36
+ // Auto fix
37
+ "editor.codeActionsOnSave": {
38
+ "source.fixAll.eslint": "explicit",
39
+ "source.organizeImports": "never"
40
+ },
41
+
42
+ // Silent the stylistic rules in you IDE, but still auto fix them
43
+ "eslint.rules.customizations": [
44
+ { "rule": "style/*", "severity": "off", "fixable": true },
45
+ { "rule": "format/*", "severity": "off", "fixable": true },
46
+ { "rule": "*-indent", "severity": "off", "fixable": true },
47
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
48
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
49
+ { "rule": "*-order", "severity": "off", "fixable": true },
50
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
51
+ { "rule": "*-newline", "severity": "off", "fixable": true },
52
+ { "rule": "*quotes", "severity": "off", "fixable": true },
53
+ { "rule": "*semi", "severity": "off", "fixable": true }
54
+ ],
55
+
56
+ // Enable eslint for all supported languages
57
+ "eslint.validate": [
58
+ "javascript",
59
+ "javascriptreact",
60
+ "typescript",
61
+ "typescriptreact",
62
+ "vue",
63
+ "html",
64
+ "markdown",
65
+ "json",
66
+ "jsonc",
67
+ "yaml",
68
+ "toml",
69
+ "xml",
70
+ "gql",
71
+ "graphql",
72
+ "astro",
73
+ "svelte",
74
+ "css",
75
+ "less",
76
+ "scss",
77
+ "pcss",
78
+ "postcss"
79
+ ]
80
+ }
81
+ ```
82
+
83
+ ## Disable base rules
84
+ You can disable the base rules by setting `phaicom: false`:
19
85
 
20
86
  ```js
21
- import phaicom from '@phaicom/eslint-config'
87
+ // eslint.config.mjs
88
+ import configs from '@phaicom/eslint-config'
22
89
 
23
- export default phaicom({
90
+ export default configs({
91
+ phaicom: false,
92
+ })
93
+ ```
94
+
95
+ ## Tailwind Support
96
+ To enable Tailwind support and enforce consistent class ordering:
97
+
98
+ 1. Install the required plugin:
99
+ ```bash
100
+ pnpm i -D eslint-plugin-readable-tailwind@beta
101
+ ```
102
+
103
+ 2. Enable Tailwind support in your config:
104
+ ```js
105
+ // eslint.config.mjs
106
+ import configs from '@phaicom/eslint-config'
107
+
108
+ export default configs({
24
109
  tailwind: true,
25
110
  })
26
111
  ```
27
- The rest of the config you can refer to https://github.com/antfu/eslint-config
112
+
113
+ This will enforce consistent ordering of Tailwind classes for better readability.
114
+ ## Additional Configurations
115
+
116
+ For other configuration options like TypeScript, Vue, React, Prettier, and more, please refer to [antfu/eslint-config](https://github.com/antfu/eslint-config).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phaicom/eslint-config",
3
3
  "type": "module",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "description": "Phaicom's config based on @antfu/eslint-config",
6
6
  "author": "Reawpai Chunsoi <reawpai.chunsoi@gmail.com> (https://github.com/phaicom)",
7
7
  "license": "MIT",