Skip to content

Commit

Permalink
relative path util added
Browse files Browse the repository at this point in the history
  • Loading branch information
dEdmishka committed Oct 20, 2023
1 parent 434a95c commit 856b647
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const toRelative = require('./src/utils/relativePath.js');

module.exports = {
'*': 'prettier --check --ignore-unknown',
'*.js': 'eslint --cache',
'*.{js,ts}': () => 'npm run typescript:check',
'*.{js,ts}': () => 'npm run cspell',
};
'*': (files) =>
`cspell --show-suggestions --quiet --gitignore ${toRelative(files)}`,
};
7 changes: 7 additions & 0 deletions src/utils/relativePath.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('node:path');

const toRelative = (files) =>
files.map((file) => path.relative(process.cwd(), file)).join(' ');


module.exports = toRelative;

0 comments on commit 856b647

Please sign in to comment.