Skip to content

Commit

Permalink
Fix glob pattern to enforce forward slashes to prevent Windows issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rasshofer committed May 13, 2022
1 parent 94826d5 commit daa4899
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ overrides:
rules:
max-len: 0
no-mixed-operators: 0
prettier/prettier: error
prettier/prettier:
- error
- endOfLine: auto
import/extensions: 0
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: 'src\\/.+\\.test\\.ts$',
testMatch: ['<rootDir>/src/**/*.test.ts'],
testPathIgnorePatterns: ['.d.ts'],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"clean": "rimraf 'dist' 'coverage'",
"build": "tsc --build --verbose",
"watch": "tsc --build --verbose --watch",
"lint": "eslint 'src/**/*.{js,ts}'",
"lint": "eslint \"src/**/*.{js,ts}\"",
"pretest": "npm run build",
"test": "jest --coverage"
},
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('YAML Lint', () => {
lintFile(resolve(__dirname, 'test123.yaml')),
).rejects.toMatchObject({
code: 'ENOENT',
errno: -2,
syscall: 'open',
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ let files: string[] = [];

(config._ || []).forEach((pattern: string) => {
files = files.concat(
globbySync(resolve(process.cwd(), pattern), {
globbySync(resolve(process.cwd(), pattern).replace(/\\/g, '/'), {
dot: true,
ignore: []
.concat(config.ignore)
.filter(Boolean)
.map((item) => resolve(process.cwd(), item)),
.map((item) => resolve(process.cwd(), item).replace(/\\/g, '/')),
absolute: true,
}),
);
Expand Down

0 comments on commit daa4899

Please sign in to comment.