Code Monkey home page Code Monkey logo

textlint-rule-date-weekday-mismatch's People

Contributors

azu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

textlint-rule-date-weekday-mismatch's Issues

Update dependency of chrono-node to v2.2.4 or higher due to CVE-2021-23371

chrono-node CVE-2021-23371: https://snyk.io/vuln/SNYK-JS-CHRONONODE-1083228

I would like to update chrono-node to v2.2.4 or higher, due to a vulnerability about a DoS attack issue.

Chrono-node v2 has breaking changes, which is critical for this textlint rule.

For Users

  • Chrono’s default now handles only international English. While in the previous version, it tried to parse with all known languages.
  • The current fully supported languages are en, ja, and fr (de and pt are partially supported). Other languages from v1 (nl and zh) are under development.
    https://github.com/wanasit/chrono#whats-changed-in-the-v2

So, following things have to be done to update chrono-node to v2.x:

  • Change the code to use the chrono-node v2.x correctly with locale support.
  • Drop the support for es (Spanish) that is not supported by chrono-node v2.x.
  • (Possibly) Drop the support for auto language detection and user will have to choose a language in textlintrc file.

(If you find it's not necessary, it's fine to just close this issue.)
(一旦Issueを立てましたが、必要ないようであればそのまま閉じていただいて構いません。)

Fix range must count the current text length, not the replacement's

I'm implementing a plugin that applies textlint fixes, and noticed that the range is being incorrectly computed.

See the example below:

$ echo '2021-07-02 (Thursday)' | textlint --format json --config samples/.textlintrc.json --stdin --stdin-filename file.md | jq
[
  {
    "messages": [
      {
        "type": "lint",
        "ruleId": "date-weekday-mismatch",
        "message": "2021-07-02 (Thursday) mismatch weekday.\n2021-07-02 (Thursday) => 2021-07-02 (Friday)",
        "index": 12,
        "line": 1,
        "column": 13,
        "severity": 2,
        "fix": {
          "range": [
            12,
            18
          ],
          "text": "Friday"
        }
      }
    ],
    "filePath": "<markdown>"
  }
]

The range should be within 8 characters (Thursday), instead of 6. If I apply the suggested range, I'll end up with Fridayay.

sh: textlint-scripts: command not found

On yarn install I get an error involving textlint-scripts.

❯ yarn install
yarn install v1.22.11
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
$ npm run --if-present build

> [email protected] build
> textlint-scripts build

sh: textlint-scripts: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.