Skip to content

Conversation

cstrahan
Copy link

This updates eslint (and other dependencies), and switches to the new eslint.config.js flat config format (see https://eslint.org/docs/latest/use/configure/migration-guide).

To preserve the split between .eslintignore and the config file, I've introduced a eslint.ignores.js file, which will be required and included from the generated config, if present.

@cstrahan
Copy link
Author

cstrahan commented Oct 15, 2025

Note that I've changed index.ts (renamed to index.js) to contain the entire config, rather than preserving previous approach where index.ts simply loads and re-exports the config file in the root of the repo.

The reason for this change: typescript-eslint automatically detects the root directory in getTSConfigRootDirFromStack, looking for a file in the callstack with a name matching /^eslint\.config\.(c|m)?(j|t)s$/; so, if index.js requires or imports the config file, then this will make typescript-eslint think that root directory is always the root directory of gts itself.

This is avoided by flipping it around: having gts's eslint.config.js require('./src/index.js').

By having index.js be a javascript file, and requiring that, we ensure that linting the gts repo will work prior to a build (if it was still index.ts, then we'd have to require ./build/src/index.js, which would only exist after compiling).

@cstrahan cstrahan force-pushed the cstrahan/eslint-plus-deps-update branch 2 times, most recently from 4515970 to 71f71c4 Compare October 15, 2025 16:17
@cstrahan cstrahan force-pushed the cstrahan/eslint-plus-deps-update branch from 71f71c4 to 0c3c171 Compare October 15, 2025 16:18
@cstrahan
Copy link
Author

I realized that, in my hastiness, I forgot to commit a couple files; fixed that in the last push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant