@codfish/eslint-config 12.0.0 → 12.0.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.
- package/README.md +6 -9
- package/index.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -255,14 +255,7 @@ preferences.
|
|
|
255
255
|
**Prettier is included and runs automatically** through ESLint for JavaScript, TypeScript, JSX, and TSX files using the
|
|
256
256
|
[built-in configuration](./prettier.js). **You don't need to install or configure Prettier separately** for basic usage.
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
install it as a dev dependency:
|
|
260
|
-
|
|
261
|
-
```sh
|
|
262
|
-
npm i -D prettier
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
You can then override the defaults by creating your own Prettier config file, or extend the built-in config:
|
|
258
|
+
You can then override the default config by creating your own Prettier config file, or extend the built-in config:
|
|
266
259
|
|
|
267
260
|
**Option 1: Extend the built-in config (Recommended)**
|
|
268
261
|
|
|
@@ -313,6 +306,11 @@ export default {
|
|
|
313
306
|
};
|
|
314
307
|
```
|
|
315
308
|
|
|
309
|
+
> [!TIP]
|
|
310
|
+
>
|
|
311
|
+
> If you want to format other file types (like Markdown, JSON, CSS, or YAML) or run Prettier directly, you can install
|
|
312
|
+
> it as a dev dependency: `npm i -D prettier`.
|
|
313
|
+
|
|
316
314
|
### Use in combination with prettier-plugin-tailwindcss
|
|
317
315
|
|
|
318
316
|
```sh
|
|
@@ -323,7 +321,6 @@ npm i -D eslint@9 @codfish/eslint-config prettier-plugin-tailwindcss
|
|
|
323
321
|
// prettier.config.js
|
|
324
322
|
|
|
325
323
|
import codfishPrettier from '@codfish/eslint-config/prettier';
|
|
326
|
-
import tailwindcss from 'prettier-plugin-tailwindcss';
|
|
327
324
|
|
|
328
325
|
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
|
|
329
326
|
export default {
|
package/index.js
CHANGED
|
@@ -146,6 +146,16 @@ export default defineConfig([
|
|
|
146
146
|
ymlPlugin.configs['flat/standard'],
|
|
147
147
|
ymlPlugin.configs['flat/prettier'], // handles conflicting rules with the yml plugin
|
|
148
148
|
|
|
149
|
+
{
|
|
150
|
+
name: 'codfish/github-yml-overrides',
|
|
151
|
+
|
|
152
|
+
files: ['.github/**/*.yml', '.github/**/*.yaml'],
|
|
153
|
+
|
|
154
|
+
rules: {
|
|
155
|
+
'yml/no-empty-mapping-value': 'off', // somewhat common in github workflows
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
|
|
149
159
|
// React configuration (dynamic)
|
|
150
160
|
ifAnyDep('react', reactConfig, []),
|
|
151
161
|
|