Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
martpie committed Jul 24, 2023
1 parent 41de33b commit f3c15d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('createWebpackMatcher', () => {

expect(matcher('/Users/Test/app/node_modules/test/node_modules/nested/some-file.js')).toBe(false);
expect(matcher('/Users/Test/app/node_modules/@scoped/scoped-module/node_modules/nested/some-file.js')).toBe(
false
false,
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fse.copySync('./src/next-transpile-modules.js', 'src/__tests__/__apps__/npm-basi
fse.copySync('./src/next-transpile-modules.js', 'src/__tests__/__apps__/yarn-workspaces/app/next-transpile-modules.js');
fse.copySync(
'./src/next-transpile-modules.js',
'src/__tests__/__apps__/yarn-workspaces-symlinks/app/next-transpile-modules.js'
'src/__tests__/__apps__/yarn-workspaces-symlinks/app/next-transpile-modules.js',
);
fse.copySync('./src/next-transpile-modules.js', 'src/__tests__/__apps__/pnpm/next-transpile-modules.js');
fse.copySync('./src/next-transpile-modules.js', 'src/__tests__/__apps__/swc/app/next-transpile-modules.js');
Expand Down
12 changes: 6 additions & 6 deletions src/next-transpile-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const withTmInitializer = (modules = [], options = {}) => {
return path.dirname(packageLookupDirectory);
} catch (err) {
throw new Error(
`next-transpile-modules - an unexpected error happened when trying to resolve "${module}". Are you sure the name of the module you are trying to transpile is correct, and it has a package.json with a "main" or an "exports" field?\n${err}`
`next-transpile-modules - an unexpected error happened when trying to resolve "${module}". Are you sure the name of the module you are trying to transpile is correct, and it has a package.json with a "main" or an "exports" field?\n${err}`,
);
}
};
Expand All @@ -147,7 +147,7 @@ const withTmInitializer = (modules = [], options = {}) => {
// Safecheck for Next < 5.0
if (!options.defaultLoaders) {
throw new Error(
'This plugin is not compatible with Next.js versions below 5.0.0 https://err.sh/next-plugins/upgrade'
'This plugin is not compatible with Next.js versions below 5.0.0 https://err.sh/next-plugins/upgrade',
);
}
if (resolveSymlinks !== undefined) {
Expand Down Expand Up @@ -200,11 +200,11 @@ const withTmInitializer = (modules = [], options = {}) => {
// .module.css
if (nextCssLoaders) {
const nextCssLoader = nextCssLoaders.oneOf.find(
(rule) => rule.sideEffects === false && regexEqual(rule.test, /\.module\.css$/)
(rule) => rule.sideEffects === false && regexEqual(rule.test, /\.module\.css$/),
);

const nextSassLoader = nextCssLoaders.oneOf.find(
(rule) => rule.sideEffects === false && regexEqual(rule.test, /\.module\.(scss|sass)$/)
(rule) => rule.sideEffects === false && regexEqual(rule.test, /\.module\.(scss|sass)$/),
);

// backwards compatibility with Next.js 13.0 (broke in 13.0.1)
Expand All @@ -227,7 +227,7 @@ const withTmInitializer = (modules = [], options = {}) => {
// Add support for Global CSS imports in transpiled modules
if (nextCssLoaders) {
const nextGlobalCssLoader = nextCssLoaders.oneOf.find(
(rule) => rule.sideEffects === true && regexEqual(rule.test, /(?<!\.module)\.css$/)
(rule) => rule.sideEffects === true && regexEqual(rule.test, /(?<!\.module)\.css$/),
);

if (nextGlobalCssLoader) {
Expand All @@ -243,7 +243,7 @@ const withTmInitializer = (modules = [], options = {}) => {
}

const nextGlobalSassLoader = nextCssLoaders.oneOf.find(
(rule) => rule.sideEffects === true && regexEqual(rule.test, /(?<!\.module)\.(scss|sass)$/)
(rule) => rule.sideEffects === true && regexEqual(rule.test, /(?<!\.module)\.(scss|sass)$/),
);

// FIXME: SASS works only when using a custom _app.js file.
Expand Down

0 comments on commit f3c15d7

Please sign in to comment.