@hiddenability/opinionated-defaults 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 HiddenAbilitree
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 ADDED
@@ -0,0 +1,69 @@
1
+ # ![Banner](/assets/banner.svg)
2
+ A collection of opinionated tooling configurations.
3
+
4
+ ## Supported Framework Configurations:
5
+ ### Eslint:
6
+ - Astro
7
+ - Elysia.js
8
+ - Next.js
9
+
10
+ #### :electric_plug: Included plugins :
11
+ - [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
12
+ - [eslint-plugin-no-relative-import-paths](https://github.com/MelvinVermeer/eslint-plugin-no-relative-import-paths)
13
+ - [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)
14
+ - [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
15
+ - [eslint-plugin-turbo](https://github.com/vercel/turborepo/tree/main/packages/eslint-plugin-turbo)
16
+ - [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
17
+ - [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional)
18
+ - [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)
19
+ - [eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next)
20
+ - [eslint-stylistic](https://github.com/eslint-stylistic/eslint-stylistic)
21
+
22
+ ### Prettier:
23
+ - Astro
24
+ - Next.js
25
+ - +Opinionated defaults
26
+
27
+ ## Usage:
28
+ #### Installation:
29
+ `bun add reasonable-defaults -d`
30
+ `npm i reasonable-defaults -D`
31
+ ### Eslint:
32
+ ```ts
33
+ import {eslintConfigConfigName} from "reasonable-defaults/eslint"
34
+
35
+ const eslintConfig = [...eslintConfigConfigName];
36
+
37
+ export default eslintConfig;
38
+ ```
39
+
40
+ ##### Supported Imports:
41
+ - eslintConfigAstro (Astro)
42
+ - eslintConfigElysia (Elysia.js)
43
+ - eslintConfigNext (Next.js)
44
+ - eslintConfigTurbo (Turborepo)
45
+ - eslintConfigBase (General rules for every project)
46
+ - eslintConfigFunctional (Enforces functional style)
47
+ - eslintConfigPrettier (Runs prettier as ESLint rules)
48
+ - eslintConfigReact (General rules for React)
49
+ - eslintConfigRelative (Forces the use of non-relative import paths using path aliases)
50
+ - eslintConfigStylistic (Code-style through ESLint rules)
51
+
52
+ ### Prettier:
53
+ ```ts
54
+ import {prettierConfigConfigName} from "reasonable-defaults/prettier"
55
+
56
+ const prettierConfig = {...prettierConfigConfigName};
57
+
58
+ export default prettierConfig;
59
+ ```
60
+
61
+ ##### Supported Imports:
62
+ - prettierConfigAstro (Astro prettier rules with Tailwind class ordering)
63
+ - prettierConfigNext (Rules for Next.js with Tailwind class ordering)
64
+ - prettierConfigBase (General rules for every project)
65
+
66
+ ## TODO:
67
+ - Improve repository structure (How to manage configuration options within eslint dir?)
68
+ - Maybe convert into monorepo with one package per tool instead of multiple exports from one package.
69
+ - Prevent importing overlapping configurations (i.e., Next.js ESLint config contains base config)
@@ -0,0 +1,2 @@
1
+ declare const astroConfig: any[];
2
+ export default astroConfig;
@@ -0,0 +1,11 @@
1
+ import baseConfig from "./base.mjs";
2
+ import eslintPluginAstro from "eslint-plugin-astro";
3
+ import tsConfig from "./typescript.mjs";
4
+ import relativeConfig from "./relative.mjs";
5
+ const astroConfig = [
6
+ ...baseConfig,
7
+ ...tsConfig,
8
+ ...relativeConfig,
9
+ eslintPluginAstro.configs.recommended
10
+ ];
11
+ export default astroConfig;
@@ -0,0 +1,2 @@
1
+ declare const config: any[];
2
+ export default config;
@@ -0,0 +1,37 @@
1
+ import eslintPluginUnicorn from "eslint-plugin-unicorn";
2
+ import js from "@eslint/js";
3
+ import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
4
+ const config = [
5
+ js.configs.recommended,
6
+ eslintPluginUnicorn.configs.recommended,
7
+ {
8
+ rules: {
9
+ "unicorn/filename-case": [
10
+ "error",
11
+ {
12
+ cases: {
13
+ kebabCase: true
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ plugins: {
21
+ "prefer-arrow-functions": preferArrowFunctions
22
+ },
23
+ rules: {
24
+ "prefer-arrow-functions/prefer-arrow-functions": [
25
+ "error",
26
+ { returnStyle: "implicit" }
27
+ ]
28
+ }
29
+ },
30
+ {
31
+ files: ["**/*.ts", "**/*.js"]
32
+ },
33
+ {
34
+ ignores: ["dist/"]
35
+ }
36
+ ];
37
+ export default config;
@@ -0,0 +1,2 @@
1
+ declare const elysiaConfig: any[];
2
+ export default elysiaConfig;
@@ -0,0 +1,11 @@
1
+ import baseConfig from "./base.mjs";
2
+ import tsConfig from "./typescript.mjs";
3
+ import functionalConfig from "./functional.mjs";
4
+ import relativeConfig from "./relative.mjs";
5
+ const elysiaConfig = [
6
+ ...baseConfig,
7
+ ...tsConfig,
8
+ ...functionalConfig,
9
+ ...relativeConfig
10
+ ];
11
+ export default elysiaConfig;
@@ -0,0 +1,2 @@
1
+ declare const functionalConfig: any[];
2
+ export default functionalConfig;
@@ -0,0 +1,13 @@
1
+ import functional from "eslint-plugin-functional";
2
+ const functionalConfig = [
3
+ functional.configs.externalTypeScriptRecommended,
4
+ functional.configs.recommended,
5
+ functional.configs.stylistic,
6
+ {
7
+ rules: {
8
+ "functional/no-expression-statements": ["off"],
9
+ "functional/no-return-void": ["off"]
10
+ }
11
+ }
12
+ ];
13
+ export default functionalConfig;
@@ -0,0 +1,11 @@
1
+ export { default as eslintConfigAstro } from './astro';
2
+ export { default as eslintConfigBase } from './base';
3
+ export { default as eslintConfigElysia } from './elysia';
4
+ export { default as eslintConfigFunctional } from './functional';
5
+ export { default as eslintConfigNext } from './next';
6
+ export { default as eslintConfigPrettier } from './prettier';
7
+ export { default as eslintConfigReact } from './react';
8
+ export { default as eslintConfigRelative } from './relative';
9
+ export { default as eslintConfigStylistic } from './stylistic';
10
+ export { default as eslintConfigTurbo } from './turbo';
11
+ export { default as eslintConfigTypescript } from './typescript';
@@ -0,0 +1,11 @@
1
+ export { default as eslintConfigAstro } from "./astro.mjs";
2
+ export { default as eslintConfigBase } from "./base.mjs";
3
+ export { default as eslintConfigElysia } from "./elysia.mjs";
4
+ export { default as eslintConfigFunctional } from "./functional.mjs";
5
+ export { default as eslintConfigNext } from "./next.mjs";
6
+ export { default as eslintConfigPrettier } from "./prettier.mjs";
7
+ export { default as eslintConfigReact } from "./react.mjs";
8
+ export { default as eslintConfigRelative } from "./relative.mjs";
9
+ export { default as eslintConfigStylistic } from "./stylistic.mjs";
10
+ export { default as eslintConfigTurbo } from "./turbo.mjs";
11
+ export { default as eslintConfigTypescript } from "./typescript.mjs";
@@ -0,0 +1,2 @@
1
+ declare const nextJsConfig: any[];
2
+ export default nextJsConfig;
@@ -0,0 +1,21 @@
1
+ import pluginNext from "@next/eslint-plugin-next";
2
+ import baseConfig from "./base.mjs";
3
+ import tsConfig from "./typescript.mjs";
4
+ import reactConfig from "./react.mjs";
5
+ import relativeConfig from "./relative.mjs";
6
+ const nextJsConfig = [
7
+ ...baseConfig,
8
+ ...reactConfig,
9
+ ...relativeConfig,
10
+ ...tsConfig,
11
+ {
12
+ plugins: {
13
+ "@next/next": pluginNext
14
+ },
15
+ rules: {
16
+ ...pluginNext.configs.recommended.rules,
17
+ ...pluginNext.configs["core-web-vitals"].rules
18
+ }
19
+ }
20
+ ];
21
+ export default nextJsConfig;
@@ -0,0 +1,2 @@
1
+ declare const eslintPrettierConfig: any[];
2
+ export default eslintPrettierConfig;
@@ -0,0 +1,3 @@
1
+ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
2
+ const eslintPrettierConfig = [eslintPluginPrettierRecommended];
3
+ export default eslintPrettierConfig;
@@ -0,0 +1,2 @@
1
+ declare const reactConfig: any[];
2
+ export default reactConfig;
@@ -0,0 +1,7 @@
1
+ import pluginReactHooks from "eslint-plugin-react-hooks";
2
+ import pluginReact from "eslint-plugin-react";
3
+ const reactConfig = [
4
+ pluginReact.configs.flat["all"],
5
+ pluginReactHooks.configs["recommended-latest"]
6
+ ];
7
+ export default reactConfig;
@@ -0,0 +1,11 @@
1
+ declare const relativeConfig: {
2
+ plugins: {
3
+ 'no-relative-import-paths': any;
4
+ };
5
+ rules: {
6
+ 'no-relative-import-paths/no-relative-import-paths': (string | {
7
+ prefix: string;
8
+ })[];
9
+ };
10
+ }[];
11
+ export default relativeConfig;
@@ -0,0 +1,15 @@
1
+ import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
2
+ const relativeConfig = [
3
+ {
4
+ plugins: {
5
+ "no-relative-import-paths": noRelativeImportPaths
6
+ },
7
+ rules: {
8
+ "no-relative-import-paths/no-relative-import-paths": [
9
+ "error",
10
+ { prefix: "@" }
11
+ ]
12
+ }
13
+ }
14
+ ];
15
+ export default relativeConfig;
@@ -0,0 +1,9 @@
1
+ declare const stylisticConfig: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
2
+ plugins: {
3
+ '@stylistic': {
4
+ rules: import("@stylistic/eslint-plugin").Rules;
5
+ configs: import("eslint").ESLint.Plugin["configs"] & import("@stylistic/eslint-plugin").Configs;
6
+ };
7
+ };
8
+ })[];
9
+ export default stylisticConfig;
@@ -0,0 +1,10 @@
1
+ import stylistic from "@stylistic/eslint-plugin";
2
+ const stylisticConfig = [
3
+ stylistic.configs.all,
4
+ {
5
+ plugins: {
6
+ "@stylistic": stylistic
7
+ }
8
+ }
9
+ ];
10
+ export default stylisticConfig;
@@ -0,0 +1,15 @@
1
+ declare const turborepoConfig: {
2
+ plugins: {
3
+ readonly turbo: import("eslint").ESLint.Plugin;
4
+ };
5
+ name: string;
6
+ rules: {
7
+ [x: string]: "error";
8
+ };
9
+ settings: {
10
+ turbo: {
11
+ cacheKey: number | import("eslint-plugin-turbo").ProjectKey;
12
+ };
13
+ };
14
+ }[];
15
+ export default turborepoConfig;
@@ -0,0 +1,3 @@
1
+ import turboPlugin from "eslint-plugin-turbo";
2
+ const turborepoConfig = [turboPlugin.configs["flat/recommended"]];
3
+ export default turborepoConfig;
@@ -0,0 +1,9 @@
1
+ declare const typescriptConfig: (import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.Config | {
2
+ languageOptions: {
3
+ parser: any;
4
+ parserOptions: {
5
+ projectService: boolean;
6
+ };
7
+ };
8
+ })[];
9
+ export default typescriptConfig;
@@ -0,0 +1,14 @@
1
+ import parser from "@typescript-eslint/parser";
2
+ import tseslint from "typescript-eslint";
3
+ const typescriptConfig = [
4
+ ...tseslint.configs.recommended,
5
+ {
6
+ languageOptions: {
7
+ parser,
8
+ parserOptions: {
9
+ projectService: true
10
+ }
11
+ }
12
+ }
13
+ ];
14
+ export default typescriptConfig;
@@ -0,0 +1,3 @@
1
+ import { type Config } from 'prettier';
2
+ declare const astroConfig: Config;
3
+ export default astroConfig;
@@ -0,0 +1,14 @@
1
+ import baseConfig from "./base.mjs";
2
+ const astroConfig = {
3
+ ...baseConfig,
4
+ plugins: ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
5
+ tailwindStylesheet: "./src/styles/global.css",
6
+ tailwindFunctions: ["cva", "clsx", "cn"],
7
+ overrides: [
8
+ {
9
+ files: "*.astro",
10
+ options: { parser: "astro" }
11
+ }
12
+ ]
13
+ };
14
+ export default astroConfig;
@@ -0,0 +1,3 @@
1
+ import { type Config } from 'prettier';
2
+ declare const config: Config;
3
+ export default config;
@@ -0,0 +1,13 @@
1
+ const config = {
2
+ trailingComma: "all",
3
+ singleQuote: true,
4
+ jsxSingleQuote: true,
5
+ tabWidth: 2,
6
+ arrowParens: "always",
7
+ bracketSpacing: true,
8
+ useTabs: false,
9
+ semi: true,
10
+ experimentalTernaries: true,
11
+ bracketSameLine: false
12
+ };
13
+ export default config;
@@ -0,0 +1,3 @@
1
+ export { default as prettierConfigNext } from './next';
2
+ export { default as prettierConfigBase } from './base';
3
+ export { default as prettierConfigAstro } from './astro';
@@ -0,0 +1,3 @@
1
+ export { default as prettierConfigNext } from "./next.mjs";
2
+ export { default as prettierConfigBase } from "./base.mjs";
3
+ export { default as prettierConfigAstro } from "./astro.mjs";
@@ -0,0 +1,3 @@
1
+ import { type Config } from 'prettier';
2
+ declare const nextConfig: Config;
3
+ export default nextConfig;
@@ -0,0 +1,8 @@
1
+ import baseConfig from "./base.mjs";
2
+ const nextConfig = {
3
+ ...baseConfig,
4
+ plugins: ["prettier-plugin-tailwindcss"],
5
+ tailwindStylesheet: "./src/globals.css",
6
+ tailwindFunctions: ["cva", "clsx", "cn"]
7
+ };
8
+ export default nextConfig;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@hiddenability/opinionated-defaults",
3
+ "description": "Opinionated default configurations for dev tools.",
4
+ "version": "0.0.1",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/HiddenAbilitree/reasonable-defaults.git"
9
+ },
10
+ "type": "module",
11
+ "scripts": {
12
+ "build": "unbuild",
13
+ "prepack": "unbuild"
14
+ },
15
+ "exports": {
16
+ "./eslint": {
17
+ "import": "./dist/eslint/index.mjs",
18
+ "types": "./dist/eslint/index.d.ts"
19
+ },
20
+ "./prettier": {
21
+ "import": "./dist/prettier/index.mjs",
22
+ "types": "./dist/prettier/index.d.ts"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "devDependencies": {
29
+ "@eslint/js": "^9.28.0",
30
+ "@next/eslint-plugin-next": "^15.4.0-canary.81",
31
+ "@stylistic/eslint-plugin": "^4.4.1",
32
+ "eslint": "^9.28.0",
33
+ "eslint-config-prettier": "^10.1.5",
34
+ "eslint-plugin-astro": "^1.3.1",
35
+ "eslint-plugin-functional": "^9.0.2",
36
+ "eslint-plugin-no-relative-import-paths": "^1.6.1",
37
+ "eslint-plugin-prefer-arrow-functions": "^3.6.2",
38
+ "eslint-plugin-prettier": "^5.4.1",
39
+ "eslint-plugin-react": "^7.37.5",
40
+ "eslint-plugin-react-hooks": "^5.2.0",
41
+ "eslint-plugin-turbo": "^2.5.4",
42
+ "eslint-plugin-unicorn": "^59.0.1",
43
+ "globals": "^16.2.0",
44
+ "jiti": "^2.4.2",
45
+ "prettier": "3.5.3",
46
+ "prettier-plugin-astro": "^0.14.1",
47
+ "prettier-plugin-tailwindcss": "0.6.11",
48
+ "reasonable-defaults": "^1.0.6",
49
+ "typescript": "^5.8.3",
50
+ "typescript-eslint": "^8.34.0",
51
+ "unbuild": "^3.5.0"
52
+ }
53
+ }