Skip to content

Bug: (fill in) #47

Answered by fasttime
ajslater asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the issue @ajslater. The recommended usage for @eslint/js (and also for @eslint/json) is to include a files specifier along with the other config properties. I.e. in the case of your config:

import js from "@eslint/js";
import json from "@eslint/json";

export default [
  {
    files: ["**/*.js"],
    rules: js.configs.recommended.rules,
  },
  {
    files: ["**/*.json"],
    language: "json/json",
    ...json.configs.recommended,
  },
];

The files list in the first config object causes the rules in js.configs.recommended to apply only to files with the .js extension, if that's what you are using for your JavaScript files, and .json files won't be linted by those rules any more…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ajslater
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working repro:needed This issue should include a reproducible example
3 participants
Converted from issue

This discussion was converted from issue #46 on November 06, 2024 15:28.