@chesapeake/stack 0.1.0 → 0.1.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.
@@ -0,0 +1,56 @@
1
+ // Copyright 2026 Chesapeake Computing
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import js from "@eslint/js";
5
+ import globals from "globals";
6
+ import reactHooks from "eslint-plugin-react-hooks";
7
+ import reactRefresh from "eslint-plugin-react-refresh";
8
+ import tseslint from "typescript-eslint";
9
+
10
+ /**
11
+ * Shared ESLint configuration for React + TypeScript apps.
12
+ * Uses strict type checking for better type safety.
13
+ *
14
+ * Note: typescript-eslint flat config API may change; see
15
+ * https://typescript-eslint.io for current recommendations.
16
+ *
17
+ * @param {object} parserOptions - TypeScript parser options
18
+ * @param {string[]} parserOptions.project - TypeScript project files (e.g., ["./tsconfig.node.json", "./tsconfig.app.json"])
19
+ * @param {string} parserOptions.tsconfigRootDir - Root directory for tsconfig resolution (use import.meta.dirname from the consuming app)
20
+ */
21
+ export function createEslintConfig(parserOptions) {
22
+ return tseslint.config(
23
+ { ignores: ["dist", "node_modules"] },
24
+ {
25
+ extends: [
26
+ js.configs.recommended,
27
+ ...tseslint.configs.strictTypeChecked,
28
+ ...tseslint.configs.stylisticTypeChecked,
29
+ ],
30
+ files: ["**/*.{ts,tsx}"],
31
+ languageOptions: {
32
+ ecmaVersion: 2020,
33
+ globals: globals.browser,
34
+ parserOptions,
35
+ },
36
+ plugins: {
37
+ "react-hooks": reactHooks,
38
+ "react-refresh": reactRefresh,
39
+ },
40
+ rules: {
41
+ ...reactHooks.configs.recommended.rules,
42
+ "react-refresh/only-export-components": [
43
+ "warn",
44
+ { allowConstantExport: true },
45
+ ],
46
+ "@typescript-eslint/unified-signatures": "off",
47
+ },
48
+ }
49
+ );
50
+ }
51
+
52
+ // Default export for ESLint to use when linting this package directly
53
+ export default createEslintConfig({
54
+ project: ["./tsconfig.json"],
55
+ tsconfigRootDir: import.meta.dirname,
56
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chesapeake/stack",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A simple, reusable React component library and design system built on shadcn/ui with Tailwind CSS",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.2.0",
@@ -33,6 +33,8 @@
33
33
  "types",
34
34
  "index.ts",
35
35
  "tailwind.preset.ts",
36
+ "eslint.config.js",
37
+ "prettier.config.js",
36
38
  "README.md",
37
39
  "LICENSE",
38
40
  "CHANGELOG.md"
@@ -0,0 +1,29 @@
1
+ // Copyright 2026 Chesapeake Computing
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /**
5
+ * Shared Prettier configuration for React + TypeScript apps.
6
+ * Import and re-export from your project's prettier.config.js.
7
+ */
8
+ export default {
9
+ // Use single quotes for consistency
10
+ singleQuote: false,
11
+ // Use semicolons for better compatibility
12
+ semi: true,
13
+ // Use 2 spaces for indentation
14
+ tabWidth: 2,
15
+ // Use spaces instead of tabs
16
+ useTabs: false,
17
+ // Print width of 80 characters
18
+ printWidth: 80,
19
+ // Trailing commas where valid in ES5 (objects, arrays, etc.)
20
+ trailingComma: "es5",
21
+ // Add spaces between brackets in object literals
22
+ bracketSpacing: true,
23
+ // Put the > of a multi-line JSX element at the end of the last line
24
+ bracketSameLine: false,
25
+ // Arrow function parentheses: always
26
+ arrowParens: "always",
27
+ // End of line: use lf for consistency across platforms
28
+ endOfLine: "lf",
29
+ };