Skip to content

Commit

Permalink
chore: export base config from eslint-config-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Feb 14, 2024
1 parent 9aa4df3 commit 1745460
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/eslint-config-eslint/README.md
Expand Up @@ -51,6 +51,28 @@ module.exports = [
];
```

### Base config

Note that the above configurations are intended for files that will run in Node.js. For files that will not run in Node.js, you should use the `base` config.

Here's an example of an `eslint.config.js` file for a website project with scripts that run in browser and CommonJS configuration files and tools that run in Node.js:

```js
const eslintConfigESLintBase = require("eslint-config-eslint/base");
const eslintConfigESLintCJS = require("eslint-config-eslint/cjs");

module.exports = [
...eslintConfigESLintBase.map(config => ({
...config,
files: ["scripts/*.js"]
})),
...eslintConfigESLintCJS.map(config => ({
...config,
files: ["eslint.config.js", ".eleventy.js", "tools/*.js"]
}))
];
```

### Where to ask for help?

Open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat) instead of filing an issue.
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-eslint/package.json
Expand Up @@ -6,6 +6,7 @@
"exports": {
"./package.json": "./package.json",
".": "./index.js",
"./base": "./base.js",
"./cjs": "./cjs.js",
"./eslintrc": "./eslintrc.js"
},
Expand Down

0 comments on commit 1745460

Please sign in to comment.