Registry / testing / lint-to-the-future-stylelint

lint-to-the-future-stylelint

JSON →
library2.1.0jsnpmunverified

A plugin for lint-to-the-future that integrates with stylelint to lint CSS files and track linting ignore comments. Current stable version 2.1.0 (released March 2025). Used to progressively enforce stylelint rules by marking files for future linting. Differentiates from direct stylelint usage by allowing incremental adoption via lint-to-the-future's ignore comment tracking. Works with stylelint v13, v14, and v15+. Requires Node 12+ (v2.x requires Node 18+).

npm install lint-to-the-future-stylelint
INSTALL
IMPORT
SIG · LINT-TO-THE-FUTURE
L
lint-to-the-future-stylelint
testingjavascriptv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lintToTheFutureStylelint
import lintToTheFutureStylelint from 'lint-to-the-future-stylelint'
const lintToTheFutureStylelint = require('lint-to-the-future-stylelint')
Package is ESM-only since v2.0.0. Requires Node >=18.
LintToTheFutureStylelintPlugin
import { LintToTheFutureStylelintPlugin } from 'lint-to-the-future-stylelint'
import { LintToTheFutureStylelint } from 'lint-to-the-future-stylelint'
Named export is available for TypeScript users. Correct symbol is LintToTheFutureStylelintPlugin.
default
import ltffStylelint from 'lint-to-the-future-stylelint'
import * as ltffStylelint from 'lint-to-the-future-stylelint'
Default export is the plugin instance. Avoid namespace import for correct usage.

Shows how to create the plugin and use it with lint-to-the-future to track stylelint-disable comments.

import { LintToTheFutureStylelintPlugin } from 'lint-to-the-future-stylelint'; const plugin = new LintToTheFutureStylelintPlugin({ // optional: specify stylelint config (default: stylelint's standard config) config: { extends: 'stylelint-config-standard' } }); // Use with lint-to-the-future: import lintToTheFuture from 'lint-to-the-future'; const lttf = new lintToTheFuture({ plugins: [plugin] }); // Then run lttf.process() to check files with stylelint-disable comments await lttf.process({ files: ['src/**/*.css'] });
Debug
Known issues
breakingv2.0.0 drops support for Node 14 and 16, and is ESM-only.
fix
Upgrade Node to >=18 and ensure project uses ESM (type: module or .mjs extension). Remove any require() calls for this package.
affects: >=2.0.0
deprecatedstylelint v13 and v14 are still supported as peer dependencies, but stylelint v15+ is recommended.
fix
Update to v2.1.0 which supports stylelint v15+. For stylelint v13/v14, stay on v1.x.
affects: >=1.0.0 <2.0.0
gotchaThe plugin only processes files with /* stylelint-disable */ comments. Files without such comments are ignored.
fix
Ensure your CSS files contain the appropriate stylelint-disable comments for lint-to-the-future to track.
affects: >=0.1.0
gotchaThe plugin uses globby for file globbing since v2.1.0; behavior may differ from previous micromatch-based ignoring.
fix
Review your ignore patterns to ensure they work with globby syntax. Refer to globby documentation.
affects: >=2.1.0
Errors
Common errors & fixes
Cannot find module 'lint-to-the-future-stylelint'
Package not installed or wrong import path (CommonJS require in ESM-only v2).
fix
npm install lint-to-the-future-stylelint@2 and use import syntax.
The requested module 'lint-to-the-future-stylelint' does not provide an export named 'default'
Using require() or import * as when package is ESM-only.
fix
Use import lintToTheFutureStylelint from 'lint-to-the-future-stylelint' (default import).
stylelint: Stylelint v15 requires Node >=18
Incompatible Node version for stylelint v15.
fix
Upgrade Node to >=18 or downgrade stylelint to v14.
lint-to-the-future-stylelint: Unknown plugin option 'configFile'
Using a config option that doesn't exist (likely confused with stylelint's configFile).
fix
Use the 'config' property as a stylelint config object, not 'configFile'.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies
stylelintrequiredpeer dependency required for linting CSS
Agent activity
2 hits · last 30 days
node
2
Resources
lint-to-the-future-stylelint — npm install lint-to-the-future-stylelint · libregistry