Skip to content

Commit

Permalink
fix: Update FlatCompat docs + typings to reflect Array (#99)
Browse files Browse the repository at this point in the history
* update typings

* Update docs
  • Loading branch information
wesbos committed Dec 28, 2022
1 parent 5d8f9c9 commit 5be711e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ const compat = new FlatCompat({
export default [

// mimic ESLintRC-style extends
compat.extends("standard", "example"),
...compat.extends("standard", "example"),

// mimic environments
compat.env({
...compat.env({
es2020: true,
node: true
}),

// mimic plugins
compat.plugins("airbnb", "react"),
...compat.plugins("airbnb", "react"),

// translate an entire config
compat.config({
...compat.config({
plugins: ["airbnb", "react"],
extends: "standard",
env: {
Expand Down
6 changes: 3 additions & 3 deletions lib/flat-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class FlatCompat {
/**
* Translates the `env` section of an ESLintRC-style config.
* @param {Object} envConfig The `env` section of an ESLintRC config.
* @returns {Object} A flag-config object representing the environments.
* @returns {Object[]} An array of flag-config objects representing the environments.
*/
env(envConfig) {
return this.config({
Expand All @@ -284,7 +284,7 @@ class FlatCompat {
/**
* Translates the `extends` section of an ESLintRC-style config.
* @param {...string} configsToExtend The names of the configs to load.
* @returns {Object} A flag-config object representing the config.
* @returns {Object[]} An array of flag-config objects representing the config.
*/
extends(...configsToExtend) {
return this.config({
Expand All @@ -295,7 +295,7 @@ class FlatCompat {
/**
* Translates the `plugins` section of an ESLintRC-style config.
* @param {...string} plugins The names of the plugins to load.
* @returns {Object} A flag-config object representing the plugins.
* @returns {Object[]} An array of flag-config objects representing the plugins.
*/
plugins(...plugins) {
return this.config({
Expand Down

0 comments on commit 5be711e

Please sign in to comment.