@epic-web/config 1.20.1 → 1.21.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,26 @@
1
+ # Consistent Filename Casing (TS)
2
+
3
+ Date: 2025-05-14
4
+
5
+ Status: accepted
6
+
7
+ ## Context
8
+
9
+ TypeScript follows the case sensitivity rules of the file system it’s running
10
+ on. This can be problematic if some developers are working in a case-sensitive
11
+ file system and others aren’t. If a file attempts to import fileManager.ts by
12
+ specifying ./FileManager.ts the file will be found in a case-insensitive file
13
+ system, but not on a case-sensitive file system.
14
+
15
+ When this option is set, TypeScript will issue an error if a program tries to
16
+ include a file by a casing different from the casing on disk.
17
+
18
+ ## Decision
19
+
20
+ Set
21
+ [`forceConsistentCasingInFileNames`](https://www.typescriptlang.org/tsconfig/forceConsistentCasingInFileNames.html)
22
+ to true in Typescript
23
+
24
+ ## Consequences
25
+
26
+ Ensure seamless workflow between developers with different operating systems.
package/eslint.js CHANGED
@@ -1,17 +1,9 @@
1
1
  import globals from 'globals'
2
+ import { has } from './utils.js'
2
3
 
3
4
  const ERROR = 'error'
4
5
  const WARN = 'warn'
5
6
 
6
- const has = (pkg) => {
7
- try {
8
- import.meta.resolve(pkg, import.meta.url)
9
- return true
10
- } catch {
11
- return false
12
- }
13
- }
14
-
15
7
  const hasTypeScript = has('typescript')
16
8
  const hasReact = has('react')
17
9
  const hasTestingLibrary = has('@testing-library/dom')
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.20.1",
7
+ "version": "1.21.1",
8
8
  "description": "Reasonable ESLint configs for epic web devs",
9
9
  "main": "index.js",
10
10
  "type": "module",
@@ -41,26 +41,26 @@
41
41
  "license": "MIT",
42
42
  "dependencies": {
43
43
  "@total-typescript/ts-reset": "^0.6.1",
44
- "@vitest/eslint-plugin": "^1.1.43",
45
- "eslint-plugin-import-x": "^4.11.0",
44
+ "@vitest/eslint-plugin": "^1.3.4",
45
+ "eslint-plugin-import-x": "^4.16.1",
46
46
  "eslint-plugin-jest-dom": "^5.5.0",
47
47
  "eslint-plugin-playwright": "^2.2.0",
48
48
  "eslint-plugin-react": "^7.37.5",
49
49
  "eslint-plugin-react-hooks": "^5.2.0",
50
- "eslint-plugin-testing-library": "^7.1.1",
51
- "globals": "^16.0.0",
52
- "prettier-plugin-tailwindcss": "^0.6.11",
50
+ "eslint-plugin-testing-library": "^7.6.1",
51
+ "globals": "^16.3.0",
52
+ "prettier-plugin-tailwindcss": "^0.6.14",
53
53
  "tslib": "^2.8.1",
54
- "typescript-eslint": "^8.31.0"
54
+ "typescript-eslint": "^8.38.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@playwright/test": "^1.52.0",
58
- "@types/react": "^19.1.2",
59
- "eslint": "^9.25.1",
57
+ "@playwright/test": "^1.54.1",
58
+ "@types/react": "^19.1.8",
59
+ "eslint": "^9.32.0",
60
60
  "npm-run-all": "^4.1.5",
61
- "prettier": "^3.5.3",
61
+ "prettier": "^3.6.2",
62
62
  "react": "^19.1.0",
63
63
  "typescript": "^5.8.3",
64
- "vitest": "^3.1.2"
64
+ "vitest": "^3.2.4"
65
65
  }
66
66
  }
package/prettier.js CHANGED
@@ -1,3 +1,7 @@
1
+ import { has } from './utils.js'
2
+
3
+ const hasTailwind = has('tailwindcss')
4
+
1
5
  /** @type {import("prettier").Options} */
2
6
  export const config = {
3
7
  arrowParens: 'always',
@@ -39,9 +43,11 @@ export const config = {
39
43
  },
40
44
  },
41
45
  ],
42
- plugins: ['prettier-plugin-tailwindcss'],
43
- tailwindAttributes: ['class', 'className', 'ngClass', '.*[cC]lassName'],
44
- tailwindFunctions: ['clsx', 'cn', 'cva'],
46
+ ...(hasTailwind && {
47
+ plugins: ['prettier-plugin-tailwindcss'],
48
+ tailwindAttributes: ['class', 'className', 'ngClass', '.*[cC]lassName'],
49
+ tailwindFunctions: ['clsx', 'cn', 'cva'],
50
+ }),
45
51
  }
46
52
 
47
53
  // this is for backward compatibility
package/typescript.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "skipLibCheck": true,
10
10
  "allowImportingTsExtensions": true,
11
11
  "noUncheckedIndexedAccess": true,
12
+ "forceConsistentCasingInFileNames": true,
12
13
  "noEmit": true
13
14
  }
14
15
  }
package/utils.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Check if a package is installed by attempting to resolve it
3
+ * @param {string} pkg - The package name to check
4
+ * @returns {boolean} - True if the package is installed, false otherwise
5
+ */
6
+ export const has = (pkg) => {
7
+ try {
8
+ import.meta.resolve(pkg, import.meta.url)
9
+ return true
10
+ } catch {
11
+ return false
12
+ }
13
+ }