mirror of
https://github.com/chillzhuang/Sword
synced 2024-12-23 01:19:24 +08:00
24 lines
917 B
JavaScript
24 lines
917 B
JavaScript
const glob = require('glob');
|
|
|
|
const getPrettierFiles = () => {
|
|
let files = [];
|
|
const configFiles = glob.sync('config/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
const mockFiles = glob.sync('mock/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
const jsFiles = glob.sync('src/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
const scriptFiles = glob.sync('scripts/**/*.js');
|
|
const tsFiles = glob.sync('src/**/*.ts*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
const lessFiles = glob.sync('src/**/*.less*', { ignore: ['**/node_modules/**', 'build/**'] });
|
|
files = files.concat(configFiles);
|
|
files = files.concat(mockFiles);
|
|
files = files.concat(jsFiles);
|
|
files = files.concat(scriptFiles);
|
|
files = files.concat(tsFiles);
|
|
files = files.concat(lessFiles);
|
|
if (!files.length) {
|
|
return;
|
|
}
|
|
return files;
|
|
};
|
|
|
|
module.exports = getPrettierFiles;
|