Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('_unused-dependencies', done => {
gulpDepcheck({
ignoreDirs: configuration.exclude,
ignoreMatches: [ 'roboter-client', 'roboter-server' ],
parsers: {
'*.js': depcheck.parser.es6,
'*.jsx': depcheck.parser.jsx
},
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [
depcheck.special.babel,
depcheck.special.eslint,
depcheck.special.mocha,
depcheck.special.webpack
]
})().
then(done).
catch(err => {
if (
err.message.includes('You have unused dependencies') ||
err.message.includes('You have missing dependencies')
) {
gutil.log(err.message);
return new Promise((resolve, reject) => {
const depcheckOptions = {
withoutDev: false,
ignoreBinPackage: false,
ignoreMatches: [],
ignoreDirs: [],
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [],
parsers: {}
};
gulp.src(config.files)
.on('data', (file: { path: string }) => {
depcheckOptions.parsers[file.path] = [
(content: string, filename: string) => {
return babylon.parse(
this.transpileService.transpile(content, filename),
{sourceType: 'module'}
);
},
depcheck.special.babel,
depcheck.special.bin,
return new Promise((resolve, reject) => {
const depcheckOptions = {
withoutDev: false,
ignoreBinPackage: false,
ignoreMatches: [],
ignoreDirs: [],
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [],
parsers: {}
};
gulp.src(config.files)
.on('data', (file: { path: string }) => {
depcheckOptions.parsers[file.path] = [
(content: string, filename: string) => {
return babylon.parse(
this.transpileService.transpile(content, filename),
{sourceType: 'module'}
);
},
depcheck.special.babel,
function checkMissingPackages(packageFile, files) {
const depcheck = require('depcheck');
const parser = require('./depcheck-parser');
const options = {
withoutDev: false,
ignoreBinPackage: false,
ignoreMatches: [],
ignoreDirs: [],
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [],
parsers: {}
};
return new Promise((resolve, reject) => {
gulpSrc(files)
.on('data', (file) => {
options.parsers[file.path] = [
parser,
depcheck.special.babel,
depcheck.special.bin,
depcheck.special.eslint,
depcheck.special.webpack
];
})
function checkMissingPackages(packageFile, files) {
const depcheck = require('depcheck');
const parser = require('./depcheck-parser');
const options = {
withoutDev: false,
ignoreBinPackage: false,
ignoreMatches: [],
ignoreDirs: [],
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [],
parsers: {}
};
return new Promise((resolve, reject) => {
gulpSrc(files)
.on('data', (file) => {
options.parsers[file.path] = [
parser,
depcheck.special.babel,
depcheck.special.bin,
depcheck.special.eslint,
depcheck.special.webpack
];
'@types/*',
'react',
'roboter',
'semantic-release-configuration',
'ts-node',
'tsconfig-paths',
'typescript'
],
parsers: {
'*.js': depcheck.parser.es6,
'*.jsx': depcheck.parser.jsx,
'*.ts': depcheck.parser.typescript,
'*.tsx': depcheck.parser.typescript
},
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [
depcheck.special.babel,
depcheck.special.bin,
depcheck.special.eslint,
depcheck.special.mocha,
depcheck.special.webpack
]
};
const {
invalidDirs,
invalidFiles,
dependencies,
devDependencies
'react',
'roboter',
'semantic-release-configuration',
'ts-node',
'tsconfig-paths',
'typescript'
],
parsers: {
'*.js': depcheck.parser.es6,
'*.jsx': depcheck.parser.jsx,
'*.ts': depcheck.parser.typescript,
'*.tsx': depcheck.parser.typescript
},
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [
depcheck.special.babel,
depcheck.special.bin,
depcheck.special.eslint,
depcheck.special.mocha,
depcheck.special.webpack
]
};
const {
invalidDirs,
invalidFiles,
dependencies,
devDependencies
} = await depcheck(directory, depcheckOptions);
gulp.task('_unused-dependencies', done => {
gulpDepcheck({
ignoreDirs: configuration.exclude,
ignoreMatches: [ 'roboter-client', 'roboter-server' ],
parsers: {
'*.js': depcheck.parser.es6,
'*.jsx': depcheck.parser.jsx
},
detectors: [
depcheck.detector.requireCallExpression,
depcheck.detector.importDeclaration
],
specials: [
depcheck.special.babel,
depcheck.special.eslint,
depcheck.special.mocha,
depcheck.special.webpack
]
})().
then(done).
catch(err => {
if (
err.message.includes('You have unused dependencies') ||
err.message.includes('You have missing dependencies')
) {
gutil.log(err.message);