@fleetia/config 1.0.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/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @fleetia/config
2
+
3
+ Shared ESLint, Prettier, and TypeScript configuration for Fleetia packages.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add -D @fleetia/config eslint prettier typescript
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ // eslint.config.js
15
+ import { reactConfig, ignorePatterns } from "@fleetia/config/eslint";
16
+
17
+ export default [reactConfig, { ignores: ignorePatterns }];
18
+ ```
19
+
20
+ ```js
21
+ // prettier.config.js
22
+ export { default } from "@fleetia/config/prettier";
23
+ ```
24
+
25
+ ```json
26
+ {
27
+ "extends": "@fleetia/config/tsconfig.base.json"
28
+ }
29
+ ```
package/eslint.base.js ADDED
@@ -0,0 +1,32 @@
1
+ import js from "@eslint/js";
2
+ import tseslint from "typescript-eslint";
3
+ import reactHooks from "eslint-plugin-react-hooks";
4
+ import reactRefresh from "eslint-plugin-react-refresh";
5
+ import globals from "globals";
6
+
7
+ /** @type {import('eslint').Linter.Config[]} */
8
+ export const typescriptConfig = [
9
+ js.configs.recommended,
10
+ ...tseslint.configs.recommended
11
+ ];
12
+
13
+ /** @type {import('eslint').Linter.Config} */
14
+ export const reactConfig = {
15
+ files: ["**/*.{ts,tsx}"],
16
+ extends: [
17
+ js.configs.recommended,
18
+ tseslint.configs.recommended,
19
+ reactHooks.configs.flat.recommended,
20
+ reactRefresh.configs.vite
21
+ ],
22
+ languageOptions: {
23
+ ecmaVersion: 2020,
24
+ globals: globals.browser
25
+ },
26
+ rules: {
27
+ "no-duplicate-imports": ["error", { includeExports: true }],
28
+ "object-shorthand": ["error", "always", { avoidQuotes: true }]
29
+ }
30
+ };
31
+
32
+ export const ignorePatterns = ["dist", "build", "storybook-static", "public"];
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@fleetia/config",
3
+ "version": "1.0.0",
4
+ "description": "Shared ESLint, Prettier, and TypeScript configuration for Fleetia packages.",
5
+ "type": "module",
6
+ "license": "AGPL-3.0-only",
7
+ "homepage": "https://github.com/fleetia/config",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/fleetia/config.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/fleetia/config/issues"
14
+ },
15
+ "exports": {
16
+ "./eslint": "./eslint.base.js",
17
+ "./prettier": "./prettier.config.js",
18
+ "./tsconfig.base.json": "./tsconfig.base.json",
19
+ "./package.json": "./package.json"
20
+ },
21
+ "files": [
22
+ "README.md",
23
+ "eslint.base.js",
24
+ "prettier.config.js",
25
+ "tsconfig.base.json"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "dependencies": {
31
+ "@eslint/js": "^9.39.4",
32
+ "eslint-plugin-react-hooks": "^7.0.1",
33
+ "eslint-plugin-react-refresh": "^0.5.2",
34
+ "globals": "^17.4.0",
35
+ "typescript-eslint": "^8.56.1"
36
+ },
37
+ "peerDependencies": {
38
+ "eslint": "^9.0.0"
39
+ }
40
+ }
@@ -0,0 +1,14 @@
1
+ /** @type {import('prettier').Config} */
2
+ export default {
3
+ arrowParens: "avoid",
4
+ bracketSameLine: false,
5
+ bracketSpacing: true,
6
+ jsxSingleQuote: false,
7
+ printWidth: 80,
8
+ semi: true,
9
+ singleQuote: false,
10
+ tabWidth: 2,
11
+ trailingComma: "none",
12
+ useTabs: false,
13
+ endOfLine: "lf"
14
+ };
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2020",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "noEmit": true,
11
+ "jsx": "react-jsx",
12
+ "esModuleInterop": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "isolatedModules": true,
15
+ "skipLibCheck": true,
16
+ "strict": true,
17
+ "strictNullChecks": true,
18
+ "allowSyntheticDefaultImports": true,
19
+ "resolveJsonModule": true
20
+ },
21
+ "exclude": ["node_modules", "dist"]
22
+ }