Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ $ npm install eslint-plugin-googleappsscript --save-dev

## Usage

### ESLint flat config

Add `import googleAppsScript from 'eslint-plugin-googleappsscript';` to `eslint.config.mjs`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add `import googleAppsScript from 'eslint-plugin-googleappsscript';` to `eslint.config.mjs`,
Add `import googleAppsScript from 'eslint-plugin-googleappsscript';` to `[eslint.config.(js|mjs|cfs)](https://eslint.org/docs/latest/use/configure/configuration-files)`,

Perhaps it would be better to list the different file types here and link to the docs.

then the block for linting `.gs` files could look like this:

```json
// Google Apps Script files
{
files: ['*.gs'],
languageOptions: {
ecmaVersion: 2020, // Google Apps Script is allegedly ES2018, but it does support ?., which requires 2020+
sourceType: 'script',
globals: {
...googleAppsScript.environments.googleappsscript.globals,
},
},
rules: {
// ...
}
},
```

### ESLint legacy config

Add `googleappsscript` to the plugins section of your `.eslintrc`
configuration file. You can omit the `eslint-plugin-` prefix. Also,
add `googleappsscript/googleappsscript": true` to `env` section:
Expand Down