@neon-pixels/prettier-config 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +49 -2
- package/index.d.ts +5 -0
- package/index.js +4 -0
- package/package.json +48 -3
- package/tailwind.d.ts +5 -0
- package/tailwind.js +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Neon Pixels Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @neon-pixels/prettier-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared [Prettier](https://prettier.io) configuration for Neon Pixels projects.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add -D prettier @neon-pixels/prettier-config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Prettier is a peer dependency, so install it yourself. For the Tailwind entry point also install the plugin:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pnpm add -D prettier-plugin-tailwindcss
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Pick one entry point.
|
|
20
|
+
|
|
21
|
+
| Entry point | What it does |
|
|
22
|
+
| --------------------------------------- | -------------------------------------------------------------------- |
|
|
23
|
+
| `@neon-pixels/prettier-config` | Prettier defaults, no overrides |
|
|
24
|
+
| `@neon-pixels/prettier-config/tailwind` | Defaults plus `prettier-plugin-tailwindcss` to sort Tailwind classes |
|
|
25
|
+
|
|
26
|
+
In `prettier.config.js`:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
export { default } from "@neon-pixels/prettier-config";
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or point `package.json` at it:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{ "prettier": "@neon-pixels/prettier-config/tailwind" }
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To override an option, spread the config:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import config from "@neon-pixels/prettier-config/tailwind";
|
|
42
|
+
|
|
43
|
+
export default { ...config, tailwindStylesheet: "./app/assets/css/main.css" };
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Tailwind v4 projects should set `tailwindStylesheet`; v3 projects set `tailwindConfig`. Paths resolve relative to the Prettier config file.
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neon-pixels/prettier-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared Prettier configuration for Neon Pixels projects.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/neonpixels-studio/packages.git",
|
|
10
|
+
"directory": "packages/prettier-config"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"default": "./index.js"
|
|
16
|
+
},
|
|
17
|
+
"./tailwind": {
|
|
18
|
+
"types": "./tailwind.d.ts",
|
|
19
|
+
"default": "./tailwind.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"index.js",
|
|
25
|
+
"index.d.ts",
|
|
26
|
+
"tailwind.js",
|
|
27
|
+
"tailwind.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": "^22.17.0 || ^24.0.0 || >=26.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"prettier": "^3.0.0",
|
|
37
|
+
"prettier-plugin-tailwindcss": ">=0.8.0 <1"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"prettier-plugin-tailwindcss": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"prettier": "^3.10.1",
|
|
46
|
+
"prettier-plugin-tailwindcss": "^0.8.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
50
|
+
}
|
|
6
51
|
}
|
package/tailwind.d.ts
ADDED
package/tailwind.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import base from "./index.js";
|
|
3
|
+
|
|
4
|
+
// Resolved from this package so the plugin is found under strict layouts
|
|
5
|
+
// (pnpm) no matter which directory Prettier runs from.
|
|
6
|
+
const tailwindPlugin = fileURLToPath(
|
|
7
|
+
import.meta.resolve("prettier-plugin-tailwindcss"),
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
/** @type {import("prettier").Config} */
|
|
11
|
+
const config = {
|
|
12
|
+
...base,
|
|
13
|
+
plugins: [...(base.plugins ?? []), tailwindPlugin],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default config;
|