Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting between lint-check and lint-staged #74503

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ test/e2e/app-dir/server-source-maps/fixtures/default/internal-pkg/sourcemapped.j
test/e2e/app-dir/server-source-maps/fixtures/default/external-pkg/sourcemapped.js
test/e2e/async-modules/amp-validator-wasm.js
test/development/next-lint-eslint-formatter-compact/**/*.js
test/e2e/app-dir/app-external/app/mixed/import/mixed-mod.mjs

# turbopack crates
turbopack/crates/*/tests/**
turbopack/crates/*/js/src/compiled
turbopack/crates/*/js/src/compiled
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"parser": "eslint-mdx",
"rules": {
"react/jsx-no-undef": "off",
"react/self-closing-comp": "error"
"react/self-closing-comp": "off"
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if you intended to change this but its probably fine

}
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/01-app/04-api-reference/02-components/form.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Form>
title: Form
description: Learn how to use the `<Form>` component to handle form submissions and search params updates with client-side navigation.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/01-app/04-api-reference/02-components/image.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Image>
title: Image
description: Optimize Images in your Next.js Application using the built-in `next/image` Component.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/01-app/04-api-reference/02-components/link.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Link>
title: Link
description: Enable fast client-side navigation with the built-in `next/link` component.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/01-app/04-api-reference/02-components/script.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Script>
title: Script
description: Optimize third-party scripts in your Next.js application using the built-in `next/script` Component.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/02-pages/03-api-reference/01-components/form.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Form>
title: Form
description: Learn how to use the `<Form>` component to handle form submissions and search params updates with client-side navigation.
source: app/api-reference/components/form
---
Expand Down
2 changes: 1 addition & 1 deletion docs/02-pages/03-api-reference/01-components/head.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Head>
title: Head
description: Add custom elements to the `head` of your page with the built-in Head component.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Image> (Legacy)
title: Image (Legacy)
description: Backwards compatible Image Optimization with the Legacy Image component.
---

Expand Down
2 changes: 1 addition & 1 deletion docs/02-pages/03-api-reference/01-components/image.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Image>
title: Image
description: Optimize Images in your Next.js Application using the built-in `next/image` Component.
source: app/api-reference/components/image
---
Expand Down
4 changes: 2 additions & 2 deletions docs/02-pages/03-api-reference/01-components/link.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: <Link>
description: API reference for the <Link> component.
title: Link
description: API reference for the `<Link>` component.
source: app/api-reference/components/link
---

Expand Down
2 changes: 1 addition & 1 deletion docs/02-pages/03-api-reference/01-components/script.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: <Script>
title: Script
description: Optimize third-party scripts in your Next.js application using the built-in `next/script` Component.
source: app/api-reference/components/script
---
Expand Down
2 changes: 1 addition & 1 deletion errors/env-key-not-allowed.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'The key "<your key>" under "env" in `next.config.js` is not allowed.'
title: 'The key `<your key>` under "env" in `next.config.js` is not allowed.'
---

## Why This Error Occurred
Expand Down
28 changes: 14 additions & 14 deletions examples/with-storybook/stories/Configure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const RightArrow = () => (
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
<a
href="https://storybook.js.org/docs/configure/styling-and-css"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-section-item">
Expand All @@ -71,7 +71,7 @@ export const RightArrow = () => (
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
<a
href="https://storybook.js.org/docs/writing-stories/decorators#context-for-mocking"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-section-item">
Expand All @@ -89,7 +89,7 @@ export const RightArrow = () => (
starting Storybook.</p>
<a
href="https://storybook.js.org/docs/configure/images-and-assets"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
</div>
Expand Down Expand Up @@ -118,7 +118,7 @@ export const RightArrow = () => (
interactive reference documentation from your components and stories.</p>
<a
href="https://storybook.js.org/docs/writing-docs/autodocs"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
Expand All @@ -133,7 +133,7 @@ export const RightArrow = () => (
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
<a
href="https://storybook.js.org/docs/sharing/publish-storybook#publish-storybook-with-chromatic"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
Expand All @@ -149,7 +149,7 @@ export const RightArrow = () => (
implementation in one place.</p>
<a
href="https://storybook.js.org/docs/sharing/design-integrations#embed-storybook-in-figma-with-the-plugin"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
Expand All @@ -165,7 +165,7 @@ export const RightArrow = () => (
complex.</p>
<a
href="https://storybook.js.org/docs/writing-tests"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
Expand All @@ -180,7 +180,7 @@ export const RightArrow = () => (
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
<a
href="https://storybook.js.org/docs/writing-tests/accessibility-testing"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
<div className="sb-grid-item">
Expand All @@ -195,7 +195,7 @@ export const RightArrow = () => (
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
<a
href="https://storybook.js.org/docs/configure/theming"
target="_blank"
target="_blank" rel="noreferrer"
>Learn more<RightArrow /></a>
</div>
</div>
Expand All @@ -207,7 +207,7 @@ export const RightArrow = () => (
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
<a
href="https://storybook.js.org/integrations/"
target="_blank"
target="_blank" rel="noreferrer"
>Discover all addons<RightArrow /></a>
</div>
<div className='sb-addon-img'>
Expand All @@ -234,7 +234,7 @@ export const RightArrow = () => (

<a
href="https://github.com/storybookjs/storybook"
target="_blank"
target="_blank" rel="noreferrer"
>Star on GitHub<RightArrow /></a>
</div>
<div className="sb-section-item">
Expand All @@ -251,7 +251,7 @@ export const RightArrow = () => (

<a
href="https://discord.gg/storybook"
target="_blank"
target="_blank" rel="noreferrer"
>Join Discord server<RightArrow /></a>
</div>
</div>
Expand All @@ -269,7 +269,7 @@ export const RightArrow = () => (

<a
href="https://www.youtube.com/@chromaticui"
target="_blank"
target="_blank" rel="noreferrer"
>Watch on YouTube<RightArrow /></a>
</div>
</div>
Expand All @@ -286,7 +286,7 @@ export const RightArrow = () => (

<a
href="https://storybook.js.org/tutorials/"
target="_blank"
target="_blank" rel="noreferrer"
>Discover tutorials<RightArrow /></a>
</div>

Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
'*.{js,jsx,mjs,ts,tsx,mts,mdx}': [
'prettier --with-node-modules --ignore-path .prettierignore --write',
'cross-env ESLINT_USE_FLAT_CONFIG=false eslint --config .eslintrc.json --fix',
'cross-env ESLINT_USE_FLAT_CONFIG=false eslint --config .eslintrc.json --no-eslintrc --fix',
],
'*.{json,md,css,html,yml,yaml,scss}': [
'prettier --with-node-modules --ignore-path .prettierignore --write',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"git-clean": "git clean -d -x -e node_modules -e packages -f",
"typescript": "tsc --noEmit",
"lint-typescript": "turbo run typescript",
"lint-eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint . --ext js,jsx,ts,tsx --config .eslintrc.cli.json --no-eslintrc",
"lint-eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint . --ext js,jsx,mjs,ts,tsx,mts,mdx --config .eslintrc.json --no-eslintrc",
Copy link
Member

Choose a reason for hiding this comment

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

Should we delete the .eslintrc.cli.json file now that its unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that is meant for use with vscode to not apply as many checks.

Copy link
Member

Choose a reason for hiding this comment

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

How would vscode know to use that file? 🤔

"lint-ast-grep": "ast-grep scan",
"lint-no-typescript": "run-p prettier-check lint-eslint lint-language",
"types-and-precompiled": "run-p lint-typescript check-precompiled validate-externals-doc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ now fully revert the conventional testing pyramid:
<a
href="https://martinfowler.com/articles/practical-test-pyramid.html#TheTestPyramid"
target="_blank"
rel="noreferrer"
>
testing pyramid
</a>
Expand Down Expand Up @@ -91,6 +92,7 @@ mostly re-used from deploy to deploy.
<a
target="_blank"
href="https://github.com/rauchg/blog/pull/35#issuecomment-570270061"
rel="noreferrer"
>
for this very blog
</a>
Expand Down
Loading