@limulus/eslint-config 6.0.1 → 6.2.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 CHANGED
@@ -1,6 +1,7 @@
1
1
  # @limulus/eslint-config
2
2
 
3
- My ESLint configuration, based on [eslint-config-universe](https://www.npmjs.com/package/eslint-config-universe).
3
+ My ESLint configuration, based on
4
+ [eslint-config-universe](https://www.npmjs.com/package/eslint-config-universe).
4
5
 
5
6
  Feel free to use for your own projects, but it is entirely subject to my own whims.
6
7
 
@@ -17,10 +18,10 @@ export default [
17
18
  files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
18
19
  languageOptions: {
19
20
  parserOptions: {
20
- project: './tsconfig.json'
21
- }
22
- }
23
- }
21
+ project: './tsconfig.json',
22
+ },
23
+ },
24
+ },
24
25
  ]
25
26
  ```
26
27
 
@@ -31,3 +32,6 @@ module.exports = {
31
32
  ...require('@limulus/eslint-config/prettier'),
32
33
  }
33
34
  ```
35
+
36
+ Markdown prose is hard-wrapped at 92 columns. This is scoped to Markdown, so YAML is left
37
+ alone.
package/index.js CHANGED
@@ -1,12 +1,60 @@
1
+ const { createRequire } = require('node:module')
2
+ const path = require('node:path')
3
+
4
+ const { SourceCode } = require('eslint')
1
5
  const { defineConfig } = require('eslint/config')
2
6
  const globals = require('globals')
3
7
  const webConfig = require('eslint-config-universe/flat/web')
4
8
  const typescriptAnalysisConfig = require('eslint-config-universe/flat/shared/typescript-analysis')
5
9
 
10
+ // TEMPORARY: delete once eslint-plugin-import ships a release newer than 2.32.0.
11
+ //
12
+ // ESLint 10 removed SourceCode#getTokenOrCommentBefore/After. eslint-plugin-import 2.32.0 still
13
+ // calls both from `import/order`, which universe enables, so any file with unsorted imports
14
+ // crashes the whole run — no --fix required, since ESLint computes fixes eagerly. Upstream fixed
15
+ // this in import-js/eslint-plugin-import#3230 (merged 2026-06-29) using exactly the substitution
16
+ // below, but that commit is unreleased. Feature-detected, so it is a no-op on ESLint 9.
17
+ if (typeof SourceCode.prototype.getTokenOrCommentBefore !== 'function') {
18
+ SourceCode.prototype.getTokenOrCommentBefore = function (node, skip) {
19
+ return this.getTokenBefore(node, { includeComments: true, skip })
20
+ }
21
+ }
22
+ if (typeof SourceCode.prototype.getTokenOrCommentAfter !== 'function') {
23
+ SourceCode.prototype.getTokenOrCommentAfter = function (node, skip) {
24
+ return this.getTokenAfter(node, { includeComments: true, skip })
25
+ }
26
+ }
27
+
28
+ // TEMPORARY: delete once eslint-plugin-react ships a release that supports ESLint 10.
29
+ //
30
+ // universe sets `react.version: 'detect'`. The plugin's detection calls `context.getFilename()`,
31
+ // which ESLint 10 removed, so it throws while loading the rule for every file the React rules
32
+ // match — plain .js included, React installed or not. eslint-plugin-react 7.37.5 (April 2025) is
33
+ // still the newest release and universe pins `^7.37.5`, so no combination of this stack can
34
+ // detect a version on ESLint 10. The peer range permits ESLint 10, so without this a consumer
35
+ // who upgrades gets a config that crashes on every file.
36
+ //
37
+ // Resolving the version up front sidesteps detection entirely, mirroring the plugin's semantics:
38
+ // whichever React is in scope, else its own '999.999.999' "assume latest" default. The one
39
+ // difference is that it resolves from process.cwd() rather than each linted file's directory, so
40
+ // a monorepo with differing React versions per package gets the root's — a narrow loss against a
41
+ // rule set that otherwise cannot run at all.
42
+ const reactVersion = (() => {
43
+ try {
44
+ const requireFromCwd = createRequire(path.join(process.cwd(), 'noop.js'))
45
+ return requireFromCwd('react/package.json').version
46
+ } catch {
47
+ return '999.999.999'
48
+ }
49
+ })()
50
+
6
51
  module.exports = defineConfig([
7
52
  ...webConfig,
8
53
  ...typescriptAnalysisConfig,
9
54
  {
55
+ settings: {
56
+ react: { version: reactVersion },
57
+ },
10
58
  languageOptions: {
11
59
  globals: {
12
60
  ...globals.node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limulus/eslint-config",
3
- "version": "6.0.1",
3
+ "version": "6.2.0",
4
4
  "description": "A shared ESLint configuration",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/limulus/eslint-config.git",
@@ -15,15 +15,15 @@
15
15
  "prettier.js"
16
16
  ],
17
17
  "scripts": {
18
- "test": "echo 'No tests, just pass.'",
18
+ "test": "node --test test/*.test.js",
19
19
  "prepare": "husky"
20
20
  },
21
21
  "publishConfig": {
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "eslint-config-universe": "^15.0.3",
26
- "globals": "^16.2.0"
25
+ "eslint-config-universe": "^16.0.0",
26
+ "globals": "^17.9.0"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "eslint": ">=9",
@@ -37,7 +37,6 @@
37
37
  "husky": "^9.1.7",
38
38
  "is-ci": "^4.1.0",
39
39
  "prettier": "^3.5.3",
40
- "semantic-release": "^25.0.3",
41
40
  "typescript": "^5.8.3"
42
41
  }
43
42
  }
package/prettier.js CHANGED
@@ -3,4 +3,12 @@ module.exports = {
3
3
  semi: false,
4
4
  singleQuote: true,
5
5
  trailingComma: 'es5',
6
+ overrides: [
7
+ {
8
+ // Scoped to Markdown deliberately: a top-level `proseWrap` would also reflow YAML
9
+ // scalars, which mangles workflow and manifest files.
10
+ files: ['*.md', '*.markdown', '*.mdx'],
11
+ options: { proseWrap: 'always' },
12
+ },
13
+ ],
6
14
  }