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

Update dependency textlint to v12.6.1 #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Dec 2, 2021

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
textlint 12.0.2 -> 12.6.1 age adoption passing confidence

Release Notes

textlint/textlint (textlint)

v12.6.1

Compare Source

What's Changed

Refactoring
Dependency Updates

Full Changelog: textlint/textlint@v12.6.0...12.6.1

v12.6.0

Compare Source

What's Changed

Features
Bug Fixes
Refactoring
Dependency Updates

Full Changelog: textlint/textlint@v12.5.1...12.6.0

v12.5.2

Compare Source

What's Changed

Features
Bug Fixes
Refactoring
Dependency Updates

Full Changelog: textlint/textlint@v12.5.1...12.5.2

v12.5.1

Compare Source

Bug Fixes

Full Changelog: textlint/textlint@v12.5.0...v12.5.1

v12.5.0

Compare Source

Features

Example:

$ cat README.md | npx textlint --stdin --stdin-filename README.md --fix --format fixed-result --output-file NEW.md

For more details, see https://textlint.github.io/docs/cli.html#pipe-to-textlint

New Contributors

Full Changelog: textlint/textlint@v12.4.0...v12.5.0

v12.4.0

Compare Source

Features
  • textlint: add --print-config flag (9aa400f)

What's Changed

Full Changelog: textlint/textlint@v12.3.1...v12.4.0

v12.3.1

Compare Source

Bug Fixes
  • deps: update babel monorepo to ^7.20.7 (30a1386)
  • textlint: fix ESM loading issue on Windows (#​972) (a6b9bf5)

v12.3.0

Compare Source

Features

Overview

  • Support Rules/Filter/Pluugins that are written in ECMAScript Modules
  • Add new CLI
  • Add new APIs: createLinter/loadTextlintrc/loadLinterFormatter/loadFixerFormatter
    • It will replace TextLintCore/TextFixEngine/TextLintEngine

📝 ESM Rules/Filter/Pluugins only works in createLinter API.
This is because TextLintCore/TextFixEngine/TextLintEngine were assumed to be synchronous processes.
createLinter API does loading as async.

Breaking Changes

No changes in existing CLI.

Difference between Old-CLI and New-CLI

  • New CLI support ESM
  • New CLI must require --stdin-filename with --stdin
    • --stdin-filename may be optional in Old-CLI
  • Correct exit status
Exit Status on new CLI

0: No Error

  • Not found lint error
  • --fix: found errors but fix all errors, so exit with 0
  • --output-file: Found lint error but --output-file is specified
  • --dryRun: Found lint error but --dryRun is specified

1: Lint Error

  • found lint error
  • --fix: found errors and could not fix all errors, so exit with 1

2: Fatal Error

  • Crash textlint process
  • Fail to load config/rule/plugin etc...

New APIs

Ww introduce new API like createLinter for supporting Async APIs.
v13 continue to support current TextLintEngine and TextFixEngine for backward compatible.

New createLinter and loadTextlintrc support ESM rules/plugins.
In other hands, TextLintEngine and TextFixEngine can not support ESM rules/plugins.

https://github.com/textlint/textlint/blob/60cea514f7eaefbff4411087d16a51daf68f12a4/packages/textlint/src/index.ts

API Description Behavior Target Platform Prev Status Next Status
cli Command LIne Interface Async Node.js ✅ (Use createTextlint internally)
textlint TextLintCore alias Async Node.js/CommonJS ❌ Deprecated ❌ Deprecated
TextLintCore Old API. It is Procedural API. Lint Only Single File. Recommended to use @​texltint/kernel module instead of It. Async Node.js/CommonJS ❌ Deprecated ❌ Deprecated
TextLintEngine Lint Engine API. It load .textlintrc automaticaly ◉ Loading is Sync
◉ Linting is Async
Node.js/CommonJS ✅ Recommended ❌ Deprecated
TextFixEngine Fix Engine API. It load .textlintrc automaticaly ◉ Loading is Sync
◉ Fixing is Async
Node.js/CommonJS ✅ Recommended ❌ Deprecated
createLinter/loadTextlintrc Support Async APIs. ◉ Loading is Async
◉ Linting/Fixing is Async
Node.js/CommonJS and ESM None ✅ Recommended
  • createLinter: create linter instance
    • lintFiles(files): lint files and return linter messages
    • lintText(text, filePath) lint text with virtual filePath and return linter messages
    • fixFiles(files lint text and return fixer messages
    • fixText(text, filePath) lint text with virtual filePath and return fixer messages
      • fixFiles and fixText does not modify files
  • loadTextlintrc: load .textlintrc config file and return a descriptor object
  • loadLinerFormatter and loadFixerFormatter: load formatter

Lint files and output to console.

import { createLinter, loadTextlintrc, loadLinterFormatter } from "textlint";
// descriptor is a structure object for linter
// It includes rules, plugins, and options
const descriptor = await loadTextlintrc();
const linter = createLinter({
    descriptor
});
const results = await linter.lintFiles(["*.md"]);
// textlint has two types formatter sets for linter and fixer
const formatter = await loadLinterFormatter({ formatterName: "stylish" })
const output = formatter.format(results);
console.log(output);

For more details, see https://textlint.github.io/docs/use-as-modules.html

How to use New CLI

New CLI is opt-in for avoiding Breaking Changes.
It will be default in next major version.

You can try new textlint CLI via textlint-esm command.

- $ textlint "**/*.md"
+ $ textlint-esm "**/*.md"

Or, when TEXTLINT_USE_NEW_CLI=1 is set, textlint use new CLI

$ TEXTLINT_USE_NEW_CLI=1 textlint "**/*.md"

🔥 Welcome to feedback on Discussion: https://github.com/textlint/textlint/discussions/968

fix #​868
fix https://github.com/textlint/textlint/issues/744 - new CLI fix this
fix https://github.com/textlint/textlint/issues/103 - new CLI fix this
fix #​797 - extends descriptor instead of Config
fix #​293 - TextlintCore will be removed in the future

v12.2.4

Compare Source

Bug Fixes

This release allow to lint dot file when setting dot file name for extensions.

{
  plugins: {
    '@​textlint/text': {
      extensions: ['.lint-todo'],
    },
  }
  rules: {
    'eol-last': true,
  }
};

This version can lint .lint-todo file.

npx textlint .lint-todo

v12.2.3

Compare Source

Bug Fixes

v12.2.2

Compare Source

Bug Fixes
  • markdown-to-ast: add mdast-util-gfm-autolink-literal to explicit deps (#​904) (d2888a5)

This will fix pnpm issue #​903

Dependencies Updates

v12.2.1

Compare Source

What's Changed

Full Changelog: textlint/textlint@v12.1.0...v12.2.1

v12.2.0

Compare Source

Features

Implement Improve error location RFC #​835
It will make the error location more details.

This change is for rule developer.

  • Add loc and range property to TextlintMessage(result)
  • Add padding prorperty to RuleError(message, details).
  • Add locator object to rule's context
    • lcoator.at(index), locator.range([startIndex, endIndex]), and locator.loc({ start: { line, column }, end: { line, column }}).
  • textlint-tester's valid and invalid support range property
  • Deprecate index, line and column property on TextlintMessage and report function
    • Preserve current behavior for backward compatible
  • Update filterMessages to use new range property on TextlintMessage
  • Use readonly [number, number] as range in all packages
  • Fix filterMessages bug https://github.com/textlint/textlint/pull/836/commits/c8a670f9b4fd7ce628a940dc4c8faabd5e62d396
  • Refactor tests
  • Update rule.md documentation
    • Add padding and locator object
    • Add peerDependencies note

textlint v12.2.0 will introduce padding and locator.
~~If your will use it, please add peerDependencies to package.json on your rule package.~~

  • Edit: No more peerDependencies. It is complex and there are less advantages.
  "peerDependencies": {
    "textlint": ">= 12.2.0"
  },
  "peerDependenciesMeta": {
    "textlint": {
      "optional": true
    }
  }

For textlint rule creator

Before:

const { Syntax, report, RuleError } = context;
// .....
report(node, new RuleError(message, {
  index: 1
}));

After:

const { Syntax, report, RuleError, locator } = context;
// .....
report(node, new RuleError(message, {
  padding: locator.at(1)
}));

If you want to get more correct location, please use locator.range or locator.loc

const { Syntax, report, RuleError, locator } = context;
// .....
report(node, new RuleError(message, {
  padding: locator.range([1, 5]) // The error related to 1 - 5 index.
}));

For more details, see https://textlint.github.io/docs/rule.html#ruleerror

Changelogs

Bug Fixes
Features

v12.1.1

Compare Source

Bug Fixes

It will resolve the following audit alert.

ansi-regex 2.1.1 ~ 5.0.0 is vulnerable to Inefficient Regular Expression Complexity: GHSA-93q8-gq69-wqmw

Thanks to @​massongit

Commits

v12.1.0

Compare Source

Features
  • kernel: allow textlint plugin to return Promise on pre/postProcess (#​832) (ae89004)

See also: https://textlint.github.io/docs/plugin.html#preprocesstext-filepath-txtparentnode---text-string-ast-txtparentnode-

  • loadFromDir: load js and ts by default (3a12798)
Bug Fixes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update dependency textlint to v12.1.0 Update dependency textlint to v12.1.1 Mar 7, 2022
@renovate renovate bot changed the title Update dependency textlint to v12.1.1 Update dependency textlint to v12.2.2 Sep 25, 2022
@renovate renovate bot changed the title Update dependency textlint to v12.2.2 Update dependency textlint to v12.2.3 Nov 20, 2022
@renovate renovate bot changed the title Update dependency textlint to v12.2.3 Update dependency textlint to v12.6.1 Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants