Thanks to visit codestin.com
Credit goes to github.com

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.

@jeromy-cannon
Copy link

this is great work, did you already file the requested information they put in their contributor page? https://github.com/google/gts?tab=contributing-ov-file

Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution, this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.

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.

2 participants