@hiddenability/opinionated-defaults-darwin-x64 0.1.7

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 (3) hide show
  1. package/README.md +158 -0
  2. package/bin/bin +0 -0
  3. package/package.json +11 -0
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # ![Banner](/assets/banner.svg)
2
+
3
+ A collection of opinionated tooling configurations.
4
+
5
+ ## Supported Framework Configurations:
6
+
7
+ ### Eslint:
8
+
9
+ - Astro
10
+ - Elysia.js
11
+ - Next.js
12
+
13
+ #### Exports:
14
+
15
+ - eslintConfig (Used to provide autocomplete)
16
+ - eslintConfigAstro (Astro)
17
+ - eslintConfigBase (General rules for every project)
18
+ - eslintConfigElysia (Elysia.js)
19
+ - eslintConfigFunctional (Enforces functional style)
20
+ - eslintConfigNext (Next.js)
21
+ - eslintConfigOxlint (Disables ESlint rules available in Oxlint)
22
+ - eslintConfigPrettier (Runs Prettier as ESLint rules)
23
+ - eslintConfigReact (General rules for React)
24
+ - eslintConfigRelative (Enforces the use of absolute import paths using path aliases)
25
+ - eslintConfigStylistic (Enforces code-style through ESLint rules)
26
+ - eslintConfigTurbo (Turborepo)
27
+
28
+ #### Included plugins:
29
+
30
+ - [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)
31
+ - [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
32
+ - [eslint-plugin-no-relative-import-paths](https://github.com/MelvinVermeer/eslint-plugin-no-relative-import-paths)
33
+ - [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)
34
+ - [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
35
+ - [eslint-plugin-turbo](https://github.com/vercel/turborepo/tree/main/packages/eslint-plugin-turbo)
36
+ - [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
37
+ - [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional)
38
+ - [eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next)
39
+ - [eslint-plugin-oxlint](https://github.com/oxc-project/eslint-plugin-oxlint)
40
+ - [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
41
+ - [eslint-stylistic](https://github.com/eslint-stylistic/eslint-stylistic)
42
+
43
+ ### Prettier:
44
+
45
+ - Astro
46
+ - Next.js
47
+ - +Opinionated defaults
48
+
49
+ #### Exports:
50
+
51
+ - prettierConfig (Used to merge configurations and provide autocomplete)
52
+ - prettierConfigAstro (Astro prettier rules with Tailwind class ordering)
53
+ - prettierConfigNext (Rules for Next.js with Tailwind class ordering)
54
+ - prettierConfigBase (General rules for every project)
55
+ - prettierConfigSortImports (Prettier-based import sorting)
56
+
57
+ #### Included plugins:
58
+
59
+ - [prettier-plugin-astro](https://github.com/withastro/prettier-plugin-astro)
60
+ - [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss)
61
+ - [prettier-plugin-sort-imports](https://github.com/trivago/prettier-plugin-sort-imports)
62
+
63
+ ## Installation:
64
+
65
+ ```
66
+ bun add @hiddenability/opinionated-defaults -d
67
+ ```
68
+
69
+ ```
70
+ npm i @hiddenability/opinionated-defaults -D
71
+ ```
72
+
73
+ ## Usage:
74
+
75
+ ### Eslint:
76
+
77
+ ```ts
78
+ // eslint.config.ts
79
+ import {
80
+ eslintConfig,
81
+ eslintConfigBase,
82
+ } from '@hiddenability/opinionated-defaults/eslint';
83
+
84
+ export default eslintConfig([
85
+ ...eslintConfigBase,
86
+ // ...eslintConfigPrettier, // other configs fit right in!
87
+ // { /* your rules here */ },
88
+ ]);
89
+ ```
90
+
91
+ ### Prettier:
92
+
93
+ ```ts
94
+ // prettier.config.mjs
95
+ import {
96
+ prettierConfig,
97
+ prettierConfigBase,
98
+ } from '@hiddenability/opinionated-defaults/prettier';
99
+
100
+ export default prettierConfig(prettierConfigBase);
101
+ ```
102
+
103
+ #### Extending/Combining Prettier Configs:
104
+
105
+ Since Prettier uses a configuration object instead of a flat config like ESLint, to extend or combine configurations, the `prettierConfig` function will merge configs for you.
106
+
107
+ ```ts
108
+ // prettier.config.mjs
109
+ import {
110
+ prettierConfig,
111
+ prettierConfig1,
112
+ prettierConfig2,
113
+ } from '@hiddenability/opinionated-defaults/prettier';
114
+
115
+ export default prettierConfig(
116
+ prettierConfig1,
117
+ prettierConfig2,
118
+ {
119
+ /* your custom rules */
120
+ },
121
+ /*...*/
122
+ );
123
+ ```
124
+
125
+ #### TailwindCSS Plugin:
126
+
127
+ When using `prettier-config-tailwind`, make sure to specify the CSS file that contains the `@import "tailwindcss"` directive.
128
+
129
+ For example, given the following css file:
130
+
131
+ ```css
132
+ /* /app/styles.css */
133
+ @import 'tailwindcss';
134
+ ```
135
+
136
+ This should be a minimal version of your Prettier config:
137
+
138
+ ```ts
139
+ // prettier.config.mjs
140
+ import {
141
+ prettierConfig,
142
+ prettierConfigBase,
143
+ prettierConfigTailwind,
144
+ } from '@hiddenability/opinionated-defaults/prettier';
145
+
146
+ export default prettierConfig(prettierConfigBase, prettierConfigTailwind, {
147
+ tailwindStylesheet: `./app/styles.css`,
148
+ });
149
+ ```
150
+
151
+
152
+ ## TODO:
153
+
154
+ - Improve repository structure (How to manage configuration options within eslint dir?).
155
+ - Maybe convert into monorepo with one package per tool instead of multiple exports from one package.
156
+ - Prevent importing overlapping configurations (i.e., Next.js ESLint config contains base config).
157
+ - Support node module resolution.
158
+ - Maybe make declarative configurations instead of just providing wrapped config modules.
package/bin/bin ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@hiddenability/opinionated-defaults-darwin-x64",
3
+ "description": "Opinionated default configurations for webdev tools.",
4
+ "version": "0.1.7",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/HiddenAbilitree/opinionated-defaults.git"
8
+ },
9
+ "os": ["$(echo darwin-x64 | cut -d '-' -f1)"],
10
+ "cpu": ["$(echo darwin-x64 | cut -d '-' -f2)"]
11
+ }