diff --git a/README.md b/README.md index 8688fd4..bf4f540 100755 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Adds details and a documentation link beside each [ESLint rule](https://eslint.o Supports all configuration file formats currently [supported by ESLint](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) -- JavaScript - use `.eslintrc.js` and export an object containing your configuration. +- JavaScript - use `.eslintrc.js` or `.eslintrc.cjs` and export an object containing your configuration. - YAML - use `.eslintrc.yaml` or `.eslintrc.yml` to define the configuration structure. - JSON - use `.eslintrc.json` to define the configuration structure. ESLint’s JSON files also allow JavaScript-style comments. - **Deprecated** - use `.eslintrc`, which can be either JSON or YAML. diff --git a/src/parsers/DocumentParser.js b/src/parsers/DocumentParser.js index 7c9899a..e72bca4 100644 --- a/src/parsers/DocumentParser.js +++ b/src/parsers/DocumentParser.js @@ -23,7 +23,7 @@ export default class DocumentParser extends Parser { if (new.target === DocumentParser) { // Choose parser based on filename and language - if (isMatch('javascript', '**/.eslintrc.js') || isMatch('javascriptreact', '**/.eslintrc.js')) { + if (isMatch('javascript', '**/.eslintrc.js', '**/.eslintrc.cjs') || isMatch('javascriptreact', '**/.eslintrc.js', '**/.eslintrc.cjs')) { return new JSParser(document); } else if (isMatch('json', '**/.eslintrc', '**/.eslintrc.json') || isMatch('jsonc', '**/.eslintrc', '**/.eslintrc.json')) { return new JSONParser(document);