Skip to content

Commit

Permalink
Address new violations of @stylistic/no-extra-parens.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Oct 7, 2024
1 parent 4f6b179 commit 61a9c24
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc/CustomRules.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
"parser": "micromark",
"function": (params, onError) => {
const blockquotes = params.parsers.micromark.tokens
.filter(((token) => token.type === "blockQuote"));
.filter((token) => token.type === "blockQuote");
for (const blockquote of blockquotes) {
const lines = blockquote.endLine - blockquote.startLine + 1;
onError({
Expand All @@ -70,7 +70,7 @@ module.exports = {
"parser": "markdownit",
"function": (params, onError) => {
const blockquotes = params.parsers.markdownit.tokens
.filter(((token) => token.type === "blockquote_open"));
.filter((token) => token.type === "blockquote_open");
for (const blockquote of blockquotes) {
const [ startIndex, endIndex ] = blockquote.map;
const lines = endIndex - startIndex;
Expand Down
2 changes: 1 addition & 1 deletion test/markdownlint-test-micromark.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test("filterByPredicate/filterByTypes", async(t) => {
t.plan(1);
const tokens = await testTokens;
const byPredicate = filterByPredicate(tokens, () => true);
const allTypes = new Set(byPredicate.map(((token) => token.type)));
const allTypes = new Set(byPredicate.map((token) => token.type));
const byTypes = filterByTypes(tokens, [ ...allTypes.values() ], true);
t.deepEqual(byPredicate, byTypes);
});
4 changes: 2 additions & 2 deletions test/rules/any-blockquote.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = [
"parser": "micromark",
"function": (params, onError) => {
const blockquotes = params.parsers.micromark.tokens
.filter(((token) => token.type === "blockQuote"));
.filter((token) => token.type === "blockQuote");
for (const blockquote of blockquotes) {
const lines = blockquote.endLine - blockquote.startLine + 1;
onError({
Expand All @@ -39,7 +39,7 @@ module.exports = [
"parser": "markdownit",
"function": (params, onError) => {
const blockquotes = params.parsers.markdownit.tokens
.filter(((token) => token.type === "blockquote_open"));
.filter((token) => token.type === "blockquote_open");
for (const blockquote of blockquotes) {
const [ startIndex, endIndex ] = blockquote.map;
const lines = endIndex - startIndex;
Expand Down
2 changes: 1 addition & 1 deletion test/rules/lint-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
"parser": "markdownit",
"function": (params, onError) => {
const fences = params.parsers.markdownit.tokens
.filter(((token) => token.type === "fence"));
.filter((token) => token.type === "fence");
for (const fence of fences) {
if (languageJavaScript.test(fence.info)) {
const results = linter.verify(fence.content, js.configs.recommended);
Expand Down
2 changes: 1 addition & 1 deletion test/rules/validate-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
"asynchronous": true,
"function": (params, onError) => {
const fences = params.parsers.markdownit.tokens
.filter(((token) => token.type === "fence"));
.filter((token) => token.type === "fence");
for (const fence of fences) {
if (/jsonc?/i.test(fence.info)) {
const errors = [];
Expand Down

0 comments on commit 61a9c24

Please sign in to comment.