Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: rework structure and improve flat config docs#8507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bradzacher merged 3 commits intomainfrombjz-rework-docs-20240219
Feb 20, 2024

Conversation

bradzacher
Copy link
Member

@bradzacherbradzacher commentedFeb 19, 2024
edited
Loading

PR Checklist

Overview

This started as me just adding some more content to the docs and evolved into me restructuring things a bit. I was going to create a whole new page on what I was going to call "advanced config" - however I later decided that we don't really need to provide that information as it is ultimately well covered by the ESLint docs.

This PR:

  • fix up some minor authoring issues like incorrect links
  • add flat config variants to all the.eslintrc.js code samples.
  • add more examples and rework thetypescript-eslint package docs.
  • updatedtypescript-eslint so that it uses both default and named exports.
  • clean up some incorrect docs and rewords some sections in the getting started guide
  • reorganise the pages a little. Previously most things were nested under the "Getting Started" header. Troubleshooting is now its own top-level header and I movedConfigs to theUsers section. This felt a little cleaner overall:
AfterBefore
before imageafter image

@bradzacherbradzacher added the documentationDocumentation ("docs") that needs adding/updating labelFeb 19, 2024
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedFeb 19, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitb4784bc
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65d3feac4235390008f1d9da
😎 Deploy Previewhttps://deploy-preview-8507--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedFeb 19, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commitb4784bc. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 33 targets

Sent with 💌 fromNxCloud.

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesFeb 19, 2024
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🔥 Looks great to me! Really liking the tweaked flow.

Some proofreading thoughts inline, nothing blocking IMO.

@JoshuaKGoldberg
Copy link
Member

Is the before/after comparison flipped in the PR description?

bradzacher reacted with thumbs up emoji

export default tseslint.config(
{
// config with just ignores is the replacement for `.eslintignore`
ignores: ['**/build/**', '**/dist/**', 'src/some/file/to/ignore.ts'],
},
Copy link

@pete-willardpete-willardFeb 19, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

question: I applaud the idea of starting the example config with a global ignore in the new flat convention but is this syntax correct? I'm getting anObject literal may only specify known properties, and 'ignores' does not exist in type 'ConfigWithExtends'. error while attempting to refactor my own config to use this exact same syntax.

bradzacher reacted with heart emoji
Copy link
MemberAuthor

@bradzacherbradzacherFeb 19, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@pete-willard try updating to (the just released) v7.0.2 first which included a fix so that TS could resolve the types correctly.

This is correct and should work just fine - it's what we do internally:

{
// config with just ignores is the replacement for `.eslintignore`
ignores:[
'**/jest.config.js',
'**/node_modules/**',
'**/dist/**',
'**/fixtures/**',
'**/coverage/**',
'**/__snapshots__/**',
'**/.docusaurus/**',
'**/build/**',
// Files copied as part of the build
'packages/types/src/generated/**/*.ts',
// Playground types downloaded from the web
'packages/website/src/vendor',
// see the file header in eslint-base.test.js for more info
'packages/rule-tester/tests/eslint-base',
],
},

I picked it as a good example of "a separate config object" and thought it was a great example cos almost every codebase I've worked on has a.eslintignore!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It is a great example to have 👍🏻 I just double checked (reinstalled packages, rebooted VSCode) and I am on the .2 version and still getting that error. Mind you my config is a.js file with the@ts-check directive. I'll try more tinkering in the morning. Sorry for hijacking the comment 😅

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I just tested this locally and it worked.
I also added a passing test case to our integration test:
https://github.com/typescript-eslint/typescript-eslint/blob/bjz-rework-docs-20240219/packages/integration-tests/fixtures/flat-config-types/eslint.config.js#L21-L24
(this test runs to typecheck and validate we haven't broken the most barebones setup).

If you can create an isolated repro repo and file an issue - I'm happy to help investigate :)

@bradzacherbradzacher merged commit7c77b1b intomainFeb 20, 2024
@bradzacherbradzacher deleted the bjz-rework-docs-20240219 branchFebruary 20, 2024 01:39
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 28, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@pete-willardpete-willardpete-willard left review comments

Assignees
No one assigned
Labels
documentationDocumentation ("docs") that needs adding/updating
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Docs: Don’t suggesttseslint.config helper in Getting Started
3 participants
@bradzacher@JoshuaKGoldberg@pete-willard

[8]ページ先頭

©2009-2025 Movatter.jp