Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 15e9dc0

Browse files
committedMar 26, 2023
feat: lit rule, use tabs, fix stylelint html 🥳
+ remove old deps. + hide ts config
1 parent ceb5989 commit 15e9dc0

8 files changed

+67
-197
lines changed
 

‎.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import("@types/eslint").Linter.Config} */
1+
/** @type {import("eslint").Linter.Config} */
22

33
module.exports = {
44
// FIXME: ./node_modules/ prefix is required, why?

‎configs/.editorconfig-example

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
root = true
44

55
[*]
6-
indent_style = space
6+
indent_style = tab
77
indent_size = 2
88
end_of_line = lf
99
charset = utf-8
@@ -16,3 +16,6 @@ indent_size = 4
1616

1717
[*.md]
1818
trim_trailing_whitespace = false
19+
20+
[*.yaml]
21+
indent_style = space

‎configs/README.md

+42-28
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ This means aligning to Prettier defaults, air-bnb rules, etc.
2828
- [Extension(s)](#extensions)
2929
- [Settings](#settings)
3030
- [Prettier](#prettier)
31-
- [Installations](#installations-1)
31+
- [Installation](#installation-1)
3232
- [Configuration](#configuration-1)
3333
- [Editorconfig](#editorconfig)
3434
- [VSCode](#vscode-1)
3535
- [Extension(s)](#extensions-1)
3636
- [Settings](#settings-1)
3737
- [Stylelint](#stylelint)
38-
- [Installations](#installations-2)
38+
- [Installations](#installations-1)
3939
- [Configuration](#configuration-2)
4040
- [VSCode](#vscode-2)
4141
- [Extension(s)](#extensions-2)
@@ -48,7 +48,6 @@ This means aligning to Prettier defaults, air-bnb rules, etc.
4848
- [Extension(s)](#extensions-4)
4949
- [TypeScript](#typescript)
5050
- [VSCode](#vscode-5)
51-
- [Project settings boilerplate](#project-settings-boilerplate)
5251
- [VSCode](#vscode-6)
5352
- [Languages](#languages)
5453
- [Astro](#astro)
@@ -79,7 +78,6 @@ Atomic configs import is planned, as each project might not need the whole range
7978
# v—————————————————————————————————— Base
8079
pnpm i -D \
8180
eslint \
82-
@types/eslint \
8381
eslint-config-airbnb-base
8482

8583
# v—————————————————————————————————— Prettier compat.
@@ -124,10 +122,12 @@ eslint-plugin-mdx
124122

125123
### Configuration
126124

127-
In `.eslintrc.cjs`:
125+
```sh
126+
touch ./.eslintrc.cjs && code -r ./.eslintrc.cjs
127+
```
128128

129129
```js
130-
/** @type {import("@types/eslint").Linter.Config} */
130+
/** @type {import("eslint").Linter.Config} */
131131

132132
module.exports = {
133133
// Prevent cascading in contained folders
@@ -193,26 +193,20 @@ In your `settings.json`:
193193

194194
## Prettier
195195

196-
### Installations
196+
### Installation
197197

198198
```sh
199-
# v—————————————————————————————————— Base
200-
pnpm i -D \
201-
@types/prettier \
202-
prettier
203-
204-
# v—————————————————————————————————— Astro
205-
pnpm i -D \
206-
prettier-plugin-astro \
207-
postcss-html
199+
pnpm i -D prettier
208200
```
209201

210202
### Configuration
211203

212-
In `.prettierrc.cjs`:
204+
```sh
205+
touch ./.prettierrc.cjs && code -r ./.prettierrc.cjs
206+
```
213207

214208
```js
215-
/** @type {import("@types/prettier").Options} */
209+
/** @type {import("prettier").Options} */
216210

217211
module.exports = {
218212
/**
@@ -324,14 +318,14 @@ pnpm i -D \
324318
stylelint-config-standard-scss \
325319
stylelint-config-recommended-scss
326320

327-
# v—————————————————————————————————— Vue
321+
# v—————————————————————————————————— Astro / Vue / HTML…
328322
pnpm i -D \
329-
stylelint-config-recommended-vue \
330-
postcss-html
323+
postcss-html \
324+
stylelint-config-html
331325

332-
# v—————————————————————————————————— Astro
326+
# v—————————————————————————————————— Vue
333327
pnpm i -D \
334-
postcss-html
328+
stylelint-config-recommended-vue
335329

336330
# v—————————————————————————————————— Prettier compat.
337331
pnpm i -D \
@@ -340,7 +334,9 @@ stylelint-config-prettier
340334

341335
### Configuration
342336

343-
In `stylelint.config.cjs`:
337+
```sh
338+
touch ./stylelint.config.cjs && code -r ./stylelint.config.cjs
339+
```
344340

345341
```js
346342
/** @type {import("@types/stylelint").Options} */
@@ -391,8 +387,24 @@ In your `settings.json`:
391387
```jsonc
392388
{
393389
// …
394-
"stylelint.validate": ["css", "postcss", "scss", "vue", "astro"],
395-
"stylelint.snippet": ["css", "postcss", "scss", "vue", "astro"]
390+
"stylelint.validate": [
391+
//
392+
"html",
393+
"css",
394+
"postcss",
395+
"scss",
396+
"vue",
397+
"astro"
398+
],
399+
"stylelint.snippet": [
400+
//
401+
"html",
402+
"css",
403+
"postcss",
404+
"scss",
405+
"vue",
406+
"astro"
407+
]
396408
// …
397409
}
398410
```
@@ -433,7 +445,9 @@ In your `settings.json`:
433445
}
434446
```
435447

436-
### Project settings boilerplate
448+
<!-- NOTE: Too specific, but can be nice to reference some tricks -->
449+
450+
<!-- ### Project settings boilerplate
437451
438452
In your `tsconfig.json`:
439453
@@ -464,7 +478,7 @@ In your `tsconfig.json`:
464478
}
465479
}
466480
}
467-
```
481+
``` -->
468482

469483
## VSCode
470484

‎configs/eslint-lit.cjs

+4
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ module.exports = {
66
'plugin:lit/recommended',
77
'plugin:lit-a11y/recommended',
88
],
9+
10+
rules: {
11+
'class-methods-use-this': ['error', { exceptMethods: ['render'] }],
12+
},
913
};

‎configs/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
],
4040
"license": "ISC",
4141
"devDependencies": {
42-
"@types/node": "^18.7.6",
43-
"prettier-plugin-astro": "0.5.0"
42+
"@types/node": "^18.7.6"
4443
}
4544
}

‎configs/pnpm-lock.yaml

-158
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configs/prettier-base.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
singleQuote: true,
77
tabWidth: 2,
88
trailingComma: 'all',
9-
useTabs: false,
9+
useTabs: true,
1010
};
1111

1212
// {

‎configs/stylelint-all.cjs

+14-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,24 @@ module.exports = {
88
'stylelint-config-standard-scss',
99
'stylelint-config-prettier',
1010
'stylelint-config-recess-order',
11+
12+
/* ALL */
13+
// 'stylelint-config-html',
14+
/* OR */
15+
'stylelint-config-html/html',
16+
'stylelint-config-html/astro',
17+
'stylelint-config-html/vue',
18+
'stylelint-config-html/xml',
19+
// "stylelint-config-html/svelte",
20+
// "stylelint-config-html/php"
1121
],
1222

13-
plugins: ['stylelint-order'],
23+
plugins: [
24+
//
25+
'stylelint-order',
26+
],
1427

1528
overrides: [
16-
// NOTE: Too unstable for now
17-
// {
18-
// files: ['*.astro', '**/*.astro'],
19-
// customSyntax: 'postcss-html',
20-
// },
2129
{
2230
files: ['*.vue', '**/*.vue'],
2331
extends: [

0 commit comments

Comments
 (0)
This repository has been archived.