diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 67ec063..bdc2980 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -27,5 +27,7 @@ overrides: rules: max-len: 0 no-mixed-operators: 0 - prettier/prettier: error + prettier/prettier: + - error + - endOfLine: auto import/extensions: 0 diff --git a/jest.config.js b/jest.config.js index 0339195..bae1315 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', - testRegex: 'src\\/.+\\.test\\.ts$', + testMatch: ['/src/**/*.test.ts'], testPathIgnorePatterns: ['.d.ts'], }; diff --git a/package.json b/package.json index 983b821..21c01bd 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 5472351..97af4c0 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -19,7 +19,6 @@ describe('YAML Lint', () => { lintFile(resolve(__dirname, 'test123.yaml')), ).rejects.toMatchObject({ code: 'ENOENT', - errno: -2, syscall: 'open', }); }); diff --git a/src/cli.ts b/src/cli.ts index 8b3d141..a335329 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -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, }), );