Skip to content

Commit

Permalink
feat: support object spread and mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Krems committed Nov 1, 2017
1 parent f501d22 commit 344fe64
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
19 changes: 19 additions & 0 deletions examples/eslint/node8/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

module.exports = Object.assign({
// Unfortunately overrides are only valid in project-level config...
overrides: [
{
files: ['**/*.mjs'],
parserOptions: {
sourceType: 'module',
},
rules: {
'node/no-unsupported-features': [2, {
version: 8,
ignores: ['modules'],
}],
},
},
],
}, require('../../../node8'));
5 changes: 5 additions & 0 deletions examples/eslint/node8/module.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import http from 'http';

export async function foo(obj) {
return { ...obj, http };
}
3 changes: 3 additions & 0 deletions lib/basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module.exports = {
parserOptions: {
ecmaVersion: 2017,
sourceType: 'script',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
plugins: ['import', 'node', 'prettier'],
};
2 changes: 1 addition & 1 deletion test/lint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function validate(filename, content) {
}

describe(`Linting using ESLint`, () => {
const files = globby.sync(`examples/**/*.js`, {
const files = globby.sync(`examples/**/*.{mjs,js}`, {
ignore: 'examples/node_modules/**/*.*',
});

Expand Down

0 comments on commit 344fe64

Please sign in to comment.