huacnlee / autocorrect

A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean).
https://huacnlee.github.io/autocorrect
MIT License
894 stars 31 forks source link

autocorrect: false doesn't work #179

Open chunyulo-code opened 8 months ago

chunyulo-code commented 8 months ago

When hit save, the symbol becomes , symbol, and this line autocorrect: false doesn't work. Did I miss something?

//before
// autocorrect: false
render: productCourses => productCourses.map(courseCode => courses.nameMap[courseCode]).join('、'),
// autocorrect: true
//after
// autocorrect: false
render: productCourses => productCourses.map(courseCode => courses.nameMap[courseCode]).join(','),
// autocorrect: true

AutoCorrectVersion:v2.6.4

huacnlee commented 4 months ago

I have do a test.

Make a test.js:

//before
// autocorrect: false
render: productCourses => productCourses.map(courseCode => courses.nameMap[courseCode]).join('、'),
// autocorrect: true

And then run autocorrect --lint test.js there is no output.

Please tell me your filename.

AutoCorrect is used the extension name to match for format type. The ignoror syntax is following the comment syntax of the format type.

So if your file not a .js or .ts, for example a .md or .txt, then AutoCorrect will regard it as a Markdown or PlainText, so the // is not a comment syntax in Markdown or PlainText, so the autocorrect: false will not work.