Skip to content

Commit 3b04261

Browse files
committed
Add ESLint config to docs/sources
1 parent 672a21f commit 3b04261

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
.cache/
22
public/
33
node_modules/
4-
docs/sources/
54
docs/sources/get-started/run-cloud-tests-from-the-CLI.md
65
docs/sources/get-started/run-your-first-tests.md
76
CONTRIBUTING_FILE_FORMAT.md
87
src/data/markdown/docs/40 xk6-disruptor/01 Get started/01 First steps.md
9-
src/data/markdown/docs/40 xk6-disruptor/01 Get started/04 Expose Your Application.md
8+
src/data/markdown/docs/40 xk6-disruptor/01 Get started/04 Expose Your Application.md
109
src/data/markdown/docs/40 xk6-disruptor/04 Examples/01 Inject Grpc faults into Service.md
1110
src/data/markdown/docs/40 xk6-disruptor/04 Examples/02 Inject HTTP faults into Pod.md
1211
src/data/markdown/docs/05 Examples/02 Tutorials/01 Get started with k6/100 Test-for-functional-behavior.md

docs/sources/.eslintrc.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es2017: true,
5+
commonjs: true,
6+
},
7+
parserOptions: {
8+
ecmaVersion: '2017',
9+
sourceType: 'module',
10+
},
11+
extends: ['plugin:mdx/recommended', 'plugin:prettier/recommended'],
12+
plugins: ['markdown'],
13+
overrides: [
14+
{
15+
// Enable the Markdown processor for all .md files.
16+
files: ['**/*.md'],
17+
processor: 'markdown/markdown',
18+
},
19+
{
20+
// Customize the configuration ESLint uses for ```js, ```javascript
21+
files: ['**/*.md/*.js', '**/*.md/*.javascript'],
22+
rules: {
23+
'no-undef': 'error',
24+
'no-else-return': 'error',
25+
'no-extra-boolean-cast': 'error',
26+
'no-duplicate-case': 'error',
27+
'no-const-assign': 'error',
28+
'no-dupe-args': 'error',
29+
'no-dupe-else-if': 'error',
30+
'no-var': 'error',
31+
'use-isnan': 'error',
32+
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
33+
'prefer-const': 'error',
34+
},
35+
},
36+
],
37+
globals: {
38+
console: 'readonly',
39+
__VU: 'readonly',
40+
__ENV: 'readonly',
41+
__ITER: 'readonly',
42+
open: 'readonly',
43+
},
44+
};

0 commit comments

Comments
 (0)