diff --git a/.eslintrc.json b/.eslintrc.json index b1e5b0a5183..68f1af34449 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,7 @@ "parser": "typescript-eslint-parser", "plugins": [ "import", + "markdown", "typescript" ], "rules": { diff --git a/docs/develeloper-guide/rules/how-to-test-rules.md b/docs/develeloper-guide/rules/how-to-test-rules.md index 743d3624609..8d14e3d29b6 100644 --- a/docs/develeloper-guide/rules/how-to-test-rules.md +++ b/docs/develeloper-guide/rules/how-to-test-rules.md @@ -34,24 +34,28 @@ need to: * `string` containing the response for `/` (HTML, plain text, etc.). * `object` with paths as properties names and their content as values: + + ```js - { - '/': 'some HTML here', - 'site.webmanifest': '{ "property1": "value1" }' - } + const tests = [{ + '/': 'some HTML here', + 'site.webmanifest': { property: 'value' } + }]; ``` * You can even specify the status code for the response for a specific path: + + ```js - { - '/': 'some HTML here', - '/site.webmanifest': { - statusCode: 200, - content: 'The content of the response' - } - } + const tests = [{ + '/': 'some HTML here', + '/site.webmanifest': { + content: 'The content of the response', + statusCode: 200 + } + }]; ``` In the last example, if you don't specify `content`, the response diff --git a/package.json b/package.json index 62a2313f447..1d7b2c93494 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build:ts": "tsc --outDir dist --rootDir src", "build": "npm-run-all build:*", "clean": "rimraf dist", - "lint": "eslint \"src/**/*.ts\"", + "lint": "eslint --ext ts src/ --ext md . --ignore-pattern dist/*", "site": "node dist/bin/sonar --debug", "test": "npm run lint && npm run clean && npm run build && nyc ava", "watch": "npm run build && npm-run-all --parallel -c watch:*", @@ -65,6 +65,7 @@ "cpx": "^1.5.0", "eslint-config-airbnb-base": "^11.1.0", "eslint-plugin-import": "^2.2.0", + "eslint-plugin-markdown": "^1.0.0-beta.4", "eslint-plugin-typescript": "^0.1.0", "express": "^4.15.2", "leche": "^2.1.2", diff --git a/src/lib/rules/disallowed-headers/disallowed-headers.md b/src/lib/rules/disallowed-headers/disallowed-headers.md index 3774ee4361a..170f1c3bad5 100644 --- a/src/lib/rules/disallowed-headers/disallowed-headers.md +++ b/src/lib/rules/disallowed-headers/disallowed-headers.md @@ -66,9 +66,9 @@ Yes, you can use: E.g. The following configuration will make the rule allow responses to be served with the `Server` HTTP headers, but not with `Custom-Header`. -```js +```json "disallowed-headers": [ "warning", { - ignore: ['Server'], - include: ['Custom-Header'] + "ignore": ["Server"], + "include": ["Custom-Header"] }] ```