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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement FlatESLint #16149

Merged
merged 59 commits into from Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6246778
New: FlatESLint class (refs #13481)
nzakas Oct 5, 2021
c1ecc69
More stuff working in isPathIgnored
nzakas Oct 6, 2021
d827c31
Fix more isPathIgnored() tests
nzakas Oct 7, 2021
e7cf334
isPathIgnored is working
nzakas Oct 8, 2021
561100d
loadFormatter works
nzakas Oct 8, 2021
9628c1b
Most methods working
nzakas Oct 11, 2021
28eb2f7
Linter mostly working with FlatConfigArray
nzakas Oct 13, 2021
bcd6abf
Fix FlatConfigArray
nzakas Oct 15, 2021
d32f8dd
Initial Linter + FlatConfigArray tests passing
nzakas Oct 15, 2021
e9390cd
FlatESLint lintText almost working
nzakas Oct 15, 2021
ac439d7
More stuff working
nzakas Oct 18, 2021
5fd975f
Make lintText() tests work
nzakas Jan 18, 2022
f8ba4d1
Start work on lintFiles()
nzakas Jan 19, 2022
a06cde3
More tests working
nzakas Jan 20, 2022
14ccb46
Refactor
nzakas Jan 24, 2022
7942ba4
Refactor findFiles()
nzakas Jan 24, 2022
a543b92
Fix error messages when no files found
nzakas Jan 28, 2022
3917a30
Fix some ignore file errors
nzakas Feb 18, 2022
9ecbefc
More tests working
nzakas Feb 23, 2022
f1c69b8
More tests passing
nzakas Feb 24, 2022
adb17c7
Fix multiple processor tests
nzakas Mar 1, 2022
b48ca3d
Finish processors tests
nzakas Mar 3, 2022
45a28c5
Fix more tests
nzakas Mar 3, 2022
ddb7fc8
Fix more tests
nzakas Mar 4, 2022
c985bdf
Fix some processor autofixing tests
nzakas Mar 7, 2022
9c70546
Tests for default ignore patterns passing
nzakas Mar 8, 2022
0df1e16
More ignore tests fixed
nzakas Mar 18, 2022
89a016d
isPathIgnored() tests passing
nzakas Mar 21, 2022
232bb98
More tests passing
nzakas Mar 21, 2022
4432281
Fix more tests
nzakas Mar 23, 2022
53b277a
More tests passing
nzakas Mar 30, 2022
ccdb48a
Fix globbing tests
nzakas Mar 31, 2022
9d5a849
Fix more tests
nzakas Apr 1, 2022
6c6b001
Fix ignores tests
nzakas Apr 20, 2022
0087a9b
Enable more tests
nzakas Apr 27, 2022
bda995b
Constructor tests passing
nzakas Jul 7, 2022
98e5964
lintText tests passing
nzakas Jul 7, 2022
fc1670a
more tests passing
nzakas Jul 11, 2022
ab37823
More tests passing
nzakas Jul 12, 2022
753e8fa
Make fixtypes tests pass
nzakas Jul 19, 2022
8ea4f4e
Add fatalErrorCount to ignore results
nzakas Jul 19, 2022
0075167
Fix outputFixes tests
nzakas Jul 19, 2022
59dff5b
Add FlatESLint to use-at-your-own-risk
nzakas Jul 19, 2022
9611dee
Disable cache option
nzakas Jul 19, 2022
251b789
Fix lint errors
nzakas Jul 20, 2022
5796283
Fix Node.js 12 compatibility
nzakas Jul 20, 2022
875a945
Fix more tests
nzakas Jul 20, 2022
c090624
fs/promises -> fs.promises
nzakas Jul 21, 2022
3f57a1a
Catch when no matching config found
nzakas Jul 21, 2022
a6b307f
Rebase and fix lint errors
nzakas Jul 21, 2022
43d7a39
Expose FlatRuleTester
nzakas Jul 21, 2022
b3e14a9
eslint-plugin-node -> eslint-plugin-n
nzakas Jul 21, 2022
b42b541
Fix unit test errors
nzakas Jul 21, 2022
6eb4e82
Make test pass in Node.js 12
nzakas Jul 21, 2022
bc8b9f0
docs: Document flat config files
nzakas Jul 22, 2022
15f9b6c
Merge branch 'flat-config-docs' into flat-eslint
nzakas Jul 26, 2022
9544001
Fix lint errors
nzakas Jul 27, 2022
fdd52cb
Fix default ignores
nzakas Jul 29, 2022
bfe2254
Merge branch 'main' into flat-eslint
btmills Aug 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 44 additions & 1 deletion docs/.eleventy.js
Expand Up @@ -156,7 +156,35 @@ module.exports = function(eleventyConfig) {
headingTag: "h2" // Heading tag when showing heading above the wrapper element
});

// add IDs to the headers
/** @typedef {import("markdown-it/lib/token")} MarkdownItToken A MarkdownIt token. */

/**
* Generates HTML markup for an inline alert.
* @param {"warning"|"tip"|"important"} type The type of alert to create.
* @param {Array<MarkdownItToken>} tokens Array of MarkdownIt tokens to use.
* @param {number} index The index of the current token in the tokens array.
* @returns {string} The markup for the alert.
*/
function generateAlertMarkup(type, tokens, index) {
if (tokens[index].nesting === 1) {
return `
<aside role="note" class="alert alert--${type}">
<svg class="alert__icon" aria-hidden="true" focusable="false" width="19" height="20" viewBox="0 0 19 20" fill="none">
<path d="M9.49999 6.66667V10M9.49999 13.3333H9.50832M17.8333 10C17.8333 14.6024 14.1024 18.3333 9.49999 18.3333C4.89762 18.3333 1.16666 14.6024 1.16666 10C1.16666 5.39763 4.89762 1.66667 9.49999 1.66667C14.1024 1.66667 17.8333 5.39763 17.8333 10Z" stroke="currentColor" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<div class="alert__content">
<span class="alert__type">${type[0].toUpperCase()}${type.slice(1)}</span>
<div class="alert__text">
`.trim();
}

return `
</div>
</div>
</aside>
`.trim();
}

const markdownIt = require("markdown-it");

eleventyConfig.setLibrary("md",
Expand All @@ -166,6 +194,21 @@ module.exports = function(eleventyConfig) {
})
.use(markdownItContainer, "correct", {})
.use(markdownItContainer, "incorrect", {})
.use(markdownItContainer, "warning", {
render(tokens, idx) {
return generateAlertMarkup("warning", tokens, idx);
}
})
.use(markdownItContainer, "tip", {
render(tokens, idx) {
return generateAlertMarkup("tip", tokens, idx);
}
})
.use(markdownItContainer, "important", {
render(tokens, idx) {
return generateAlertMarkup("important", tokens, idx);
}
})
.disable("code"));

//------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Expand Up @@ -23,6 +23,7 @@
"@11ty/eleventy-navigation": "^0.3.2",
"@11ty/eleventy-plugin-rss": "^1.1.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
"@types/markdown-it": "^12.2.3",
"algoliasearch": "^4.12.1",
"dom-parser": "^0.1.6",
"eleventy-plugin-nesting-toc": "^1.3.0",
Expand Down
3 changes: 3 additions & 0 deletions docs/src/assets/scss/components/alert.scss
Expand Up @@ -66,6 +66,9 @@
offset-block-start: 2px;
}

.alert__text > p {
margin: 0;
}

.alert__type {
display: block;
Expand Down
1 change: 1 addition & 0 deletions docs/src/assets/scss/foundations.scss
Expand Up @@ -159,6 +159,7 @@ hr {
code,
pre {
font-family: var(--mono-font);
font-variant-ligatures: none;
}

code {
Expand Down