diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-02-10 17:20:37 +0300 |
---|---|---|
committer | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-03-06 18:05:39 +0300 |
commit | 0afc8ac12e99ae0791dc12f989400875a85b646b (patch) | |
tree | 16bc7912f54d6b48f5a98e94e539bb2679ed5313 /.eslintrc.js | |
parent | 09461649a8b8590606cface183f29ad3f5723852 (diff) |
tools: add support for mjs and cjs JS snippet linting
Refs: https://github.com/nodejs/node/pull/37162
Refs: https://github.com/nodejs/remark-preset-lint-node/pull/176
PR-URL: https://github.com/nodejs/node/pull/37311
Refs: https://github.com/eslint/eslint-plugin-markdown/pull/172
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 92e00d7c920..291436cdc4f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,12 +53,6 @@ module.exports = { overrides: [ { files: [ - 'doc/api/esm.md/*.js', - 'doc/api/fs.md/*.js', - 'doc/api/module.md/*.js', - 'doc/api/modules.md/*.js', - 'doc/api/packages.md/*.js', - 'doc/api/wasi.md/*.js', 'test/es-module/test-esm-type-flag.js', 'test/es-module/test-esm-type-flag-alias.js', '*.mjs', @@ -71,10 +65,21 @@ module.exports = { processor: 'markdown/markdown', }, { - files: ['**/*.md/*.js'], - parserOptions: { ecmaFeatures: { impliedStrict: true } }, + files: ['**/*.md/*.cjs', '**/*.md/*.js'], + parserOptions: { + sourceType: 'script', + ecmaFeatures: { impliedStrict: true } + }, rules: { strict: 'off' }, }, + { + files: [ + '**/*.md/*.mjs', + 'doc/api/esm.md/*.js', + 'doc/api/packages.md/*.js', + ], + parserOptions: { sourceType: 'module' }, + }, ], rules: { // ESLint built-in rules |