Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jun 14, 2024
1 parent d8eaddf commit 360067f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ember-scoped-css/src/lib/path/template-transform-paths.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import path from 'node:path';

import { existsSync } from 'fs';

import { findWorkspacePath, withoutExtension } from './utils';
import { findWorkspacePath } from './utils';

/**
* template plugins do not hand us the correct file path.
Expand Down Expand Up @@ -36,7 +34,10 @@ export function fixFilename(filename) {
* - the filename looks like an absolute path, but swapped out the 'app' part of the path
* with the module name, so the file paths never exist on disk
*/
if (!fileName.includes('/app/') && !fileName.includes('/node_modules/.embroider/')) {
if (
!fileName.includes('/app/') &&
!fileName.includes('/node_modules/.embroider/')
) {
let maybeModule = fileName.replace(workspace, '');
let [maybeScope, ...rest] = maybeModule.split('/').filter(Boolean);
let parts = rest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ describe('fixFilename()', () => {
let corrected = fixFilename(file);

expect(corrected).to.equal(
path.join(paths.embroiderApp, 'app/components/app/page/template-only.hbs'),
path.join(
paths.embroiderApp,
'app/components/app/page/template-only.hbs',
),
);
});

Expand Down

0 comments on commit 360067f

Please sign in to comment.