Skip to content

Commit

Permalink
chore(commonjs): linting
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsDenBakker committed Jan 10, 2020
1 parent 7d61617 commit 9f2db99
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 166 deletions.
8 changes: 4 additions & 4 deletions packages/commonjs/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { realpathSync, existsSync } from 'fs';
import { extname, resolve, normalize } from 'path';
import { extname } from 'path';

import { sync as nodeResolveSync, isCore } from 'resolve';
import { createFilter } from '@rollup/pluginutils';

import { peerDependencies } from '../package.json';
Expand Down Expand Up @@ -77,7 +75,9 @@ export default function commonjs(options = {}) {

buildStart() {
if (options.namedExports != null) {
this.warn('The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.');
this.warn(
'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
);
}

const [major, minor] = this.meta.rollupVersion.split('.').map(Number);
Expand Down
7 changes: 5 additions & 2 deletions packages/commonjs/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ test.serial('handles symlinked node_modules with preserveSymlinks: false', (t) =
resolve({
preserveSymlinks: false,
preferBuiltins: false
}),
})
]
})
.then((v) => {
Expand Down Expand Up @@ -638,5 +638,8 @@ test('logs a warning when the deprecated namedExports option is used', async (t)
});

await getCodeFromBundle(bundle);
t.is(message, 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.');
t.is(
message,
'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
);
});
Loading

0 comments on commit 9f2db99

Please sign in to comment.