Skip to content

Commit

Permalink
feat: new option extensions (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogobbosouza authored Sep 24, 2019
1 parent 9f6ea1d commit 4093800
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ yarn add --dev @nuxtjs/eslint-module # or npm install --save-dev @nuxtjs/eslint-

## Options

### `extensions`

- Default: `['ts', 'js', 'vue']`

Extensions that will be used by the loader.

### `cache`

- Default: `false`
Expand Down
3 changes: 2 additions & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = function (moduleOptions) {
}

const options = {
extensions: ['ts', 'js', 'vue'],
...this.options.eslint,
...moduleOptions
}
Expand All @@ -32,7 +33,7 @@ module.exports = function (moduleOptions) {
if (isDev && isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
test: RegExp(`\\.(${options.extensions.join('|')})$`),
loader: 'eslint-loader',
exclude: /(node_modules)/,
options
Expand Down

0 comments on commit 4093800

Please sign in to comment.