sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
601 stars 57 forks source link

Fix matching of opening curly quote in description #127

Closed kdeldycke closed 3 years ago

kdeldycke commented 3 years ago

Without this fix, an item of the form:

- [What Google Learned From Its Quest to Build the Perfect Team](https://www.nytimes.com/2016/02/28/magazine/what-google-learned-from-its-quest-to-build-the-perfect-team.html) - “Google's data indicated that psychological safety, more than anything else, was critical to making a team work. (…) The behaviors that create psychological safety — conversational turn-taking and empathy — are part of the same unwritten rules we often turn to, as individuals, when we need to establish a bond.”

gets reported under the following linting error:

  ✖  105:176  List item description must start with valid casing            remark-lint:awesome-list-item

See for instance: https://github.com/kdeldycke/awesome-management/runs/1291575555?check_suite_focus=true

sindresorhus commented 3 years ago

Can you add a fixture so this is tested?

https://github.com/sindresorhus/awesome-lint/blob/master/test/fixtures/list-item/0.md

kdeldycke commented 3 years ago

You're right @sindresorhus and I'm sorry, I was a little lazy on that one. Just added a fixture to catch this issue.

Without the fix:

❯ npm test

> awesome-lint@0.16.0 test
> xo && ava

  (...)

  1 test failed

  rules › list-item › list-item - valid

  /Users/kde/awesome-lint/test/rules/list-item.js:13

   12:   const messages = await lint({config, filename: 'test/fixtures/list-item/0.md'});
   13:   t.deepEqual(messages, []);                                                      
   14: });                                                                               

  Difference:

    [
  -   Object { … },
    ]

  test/rules/list-item.js:13:4
  processTicksAndRejections (node:internal/process/task_queues:93:5)

npm ERR! code 1
npm ERR! path /Users/kde/awesome-lint
npm ERR! command failed
npm ERR! command sh -c xo && ava

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kde/.npm/_logs/2020-10-26T10_03_55_156Z-debug.log

After the fix:

❯ npm test

> awesome-lint@0.16.0 test
> xo && ava

  (...)

  65 tests passed
sindresorhus commented 3 years ago

Thanks :)

kdeldycke commented 3 years ago

Thanks @sindresorhus for the merge! :)