Skip to content

Config per file with comments #1227

@weary-adventurer

Description

@weary-adventurer

In ESLint, you can specify globals per file using a comment:

/* global A, B */
A = B * 2;

You also used to be able to specify an environment but it no longer works in latest releases:

/* eslint-env node */
const fs = require("fs"); // used to work but not anymore

I'm used to this comment configuration and it feels much better to use as there is no setup and it just works (unless someone decides to "deprecate" it and it stops working)

I saw that quick-lint-js also supports environment and globals with global groups, but it's part of a single configuration. It would be very useful if parts of the configuration could be parsed from the comments like ESLint used to do (at least globals and env).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions