Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

chore: Enable containers #950

Merged
merged 3 commits into from Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
6 changes: 6 additions & 0 deletions _11ty/plugins/markdown-plugins.js
@@ -1,6 +1,7 @@
"use strict";

const markdownIt = require("markdown-it");
const markdownItContainer = require("markdown-it-container");
const highlightJS = require("highlight.js");
const { slug } = require("github-slugger");

Expand Down Expand Up @@ -38,5 +39,10 @@ module.exports = function syntaxHighlighting(eleventyConfig) {
uniqueSlugStartIndex: 1
});

// add markdown containers
md = md
.use(require("markdown-it-container"), "correct", {})
.use(require("markdown-it-container"), "incorrect", {});
nzakas marked this conversation as resolved.
Show resolved Hide resolved

eleventyConfig.setLibrary("md", md);
};
40 changes: 28 additions & 12 deletions docs/rules/semi.md
Expand Up @@ -12,8 +12,6 @@ further_reading:
- https://web.archive.org/web/20200420230322/http://inimino.org/~inimino/blog/javascript_semicolons
---



(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

Requires or disallows semicolons instead of ASI.
Expand Down Expand Up @@ -100,6 +98,8 @@ Object option (when `"never"`):

Examples of **incorrect** code for this rule with the default `"always"` option:

::: incorrect

```js
/*eslint semi: ["error", "always"]*/

Expand All @@ -114,8 +114,12 @@ class Foo {
}
```

:::

Examples of **correct** code for this rule with the default `"always"` option:

::: correct

```js
/*eslint semi: "error"*/

Expand All @@ -130,10 +134,14 @@ class Foo {
}
```

:::

### never

Examples of **incorrect** code for this rule with the `"never"` option:

::: incorrect

```js
/*eslint semi: ["error", "never"]*/

Expand All @@ -148,8 +156,12 @@ class Foo {
}
```

:::

Examples of **correct** code for this rule with the `"never"` option:

::: correct

```js
/*eslint semi: ["error", "never"]*/

Expand Down Expand Up @@ -180,10 +192,14 @@ class Foo {
}
```

:::

#### omitLastInOneLineBlock

Examples of additional **correct** code for this rule with the `"always", { "omitLastInOneLineBlock": true }` options:

::: correct

```js
/*eslint semi: ["error", "always", { "omitLastInOneLineBlock": true}] */

Expand All @@ -200,10 +216,14 @@ class C {
}
```

:::

#### beforeStatementContinuationChars

Examples of additional **incorrect** code for this rule with the `"never", { "beforeStatementContinuationChars": "always" }` options:

::: incorrect

```js
/*eslint semi: ["error", "never", { "beforeStatementContinuationChars": "always"}] */
import a from "a"
Expand All @@ -213,8 +233,12 @@ import a from "a"
})()
```

:::

Examples of additional **incorrect** code for this rule with the `"never", { "beforeStatementContinuationChars": "never" }` options:

::: incorrect

```js
/*eslint semi: ["error", "never", { "beforeStatementContinuationChars": "never"}] */
import a from "a"
Expand All @@ -224,16 +248,8 @@ import a from "a"
})()
```

:::

## When Not To Use It

If you do not want to enforce semicolon usage (or omission) in any particular way, then you can turn this rule off.

## Version

This rule was introduced in ESLint 0.0.6.

## Resources

* [Rule source](https://github.com/eslint/eslint/tree/HEAD/lib/rules/semi.js)
* [Test source](https://github.com/eslint/eslint/tree/HEAD/tests/lib/rules/semi.js)
* [Documentation source](https://github.com/eslint/eslint/tree/HEAD/docs/src/rules/semi.md)
nzakas marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -70,6 +70,7 @@
"luxon": "^1.24.1",
"markdown-it": "^12.3.2",
"markdown-it-anchor": "^6.0.0",
"markdown-it-container": "^3.0.0",
"morgan": "^1.10.0",
"node-fetch": "^2.6.7",
"node-polyfill-webpack-plugin": "^1.0.3",
Expand Down
11 changes: 0 additions & 11 deletions src/styles/lib/overrides.less
Expand Up @@ -49,17 +49,6 @@ body {
}

p {
&.incorrect + div + div + div > pre, /* vars-on-top */
&.incorrect + div + div > pre, /* no-continue */
&.incorrect + div > pre {
background-color: #fff6f6; /* hsl(0,100%,98%) light red */
}

&.correct + div + div + div > pre, /* vars-on-top */
&.correct + div + div > pre, /* no-continue */
&.correct + div > pre {
background-color: #f6fff6; /* hsl(120,100%,98%) light green */
}

&.icon {
position:relative;
Expand Down