Upgrading stylelint 17 to 18
Breaking17.16.0 → 18.0.0Breaking6Platform1New9Changed6Fixed16
6 breaking changes and a platform requirement change.
- Removes support for CommonJS-style filename-less and extension-less locator paths.
- Removes resolution of packages from the global node_modules directory.
- Removes the context.fix property.
- Removes the declaration-block-single-line-max-declarations rule.
stylelint publishes an official migration guide for version 18. It covers more than the release notes do.
Migrating to `18.0.0` guide ↗Node.js requirement changed in 18.0.0-next.0: >=20.19.0 → ^22.22.2 || ^24.15.0 || >=26.0.0.
Adds picomatch ^4.0.7, tinyglobby ^0.2.17.
Drops css-functions-list, debug, fast-glob, fastest-levenshtein, file-entry-cache, global-modules, globby, globjoin, html-tags, mathml-tag-names, meow, micromatch, normalize-path, picocolors, string-width, supports-hyperlinks, svg-tags, table.
Installs 30 packages in all (was 115).
Also installs fdir.
No longer installs @babel/code-frame, @babel/helper-validator-identifier, @cacheable/memory, @cacheable/utils, @keyv/bigmap, @keyv/serialize, @nodelib/fs.scandir, @nodelib/fs.stat, @nodelib/fs.walk, @sindresorhus/merge-streams, ajv, ansi-regex, ansi-styles, astral-regex, braces and 51 more.
Moves argparse 2.0.1 → 3.0.4, cosmiconfig 9.0.2 → 10.0.1, js-yaml 4.3.2 → 5.5.0, picomatch 2.3.2 → 4.0.7, write-file-atomic 7.0.1 → 8.0.0. Your build may pick other versions.
What you must change
context.fixdeclaration-block-single-line-max-declarationsdeclaration-property-value-no-unknownselector-max-specificityignoreSelectorsAPI changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- changed:
type stylelint.LinterResult = { cwd: string; results: LintResult[]; errored: boolean; report: string; code?: string; maxWarningsExceeded?: { maxWarnings: number; foundWarnings: number }; re… → type stylelint.LinterResult = { cwd: string; results: LintResult[]; errored: boolean; report: string; code?: string; maxWarningsExceeded?: { maxWarnings: number; foundWarnings: number }; co… - changed:
type stylelint.PublicApi = PostCSS.PluginCreator<PostcssPluginOptions> & { lint: (options: LinterOptions) => Promise<LinterResult>; rules: { readonly [name in keyof CoreRules]: Promise<C… → type stylelint.PublicApi = PostCSS.PluginCreator<PostcssPluginOptions> & { version: string; lint: (options: LinterOptions) => Promise<LinterResult>; rules: { readonly [name in keyof Core… - changed:
type stylelint.RuleContext = { configurationComment?: string | undefined; fix?: boolean | undefined; newline?: string | undefined } → type stylelint.RuleContext = { configurationComment?: string | undefined; newline?: string | undefined } - added:
type stylelint.GlobbyOptions = { braceExpansion?: boolean; caseSensitiveMatch?: boolean; dot?: boolean; extglob?: boolean; followSymbolicLinks?: boolean; ignore?: OneOrMany<string> }