Skip to content

Commit

Permalink
fix: simple define codelyzer as string
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguttandin committed Jan 10, 2019
1 parent df316bc commit 0073404
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions src/module.js
@@ -1,30 +1,3 @@
const { statSync } = require('fs');
const { dirname, resolve } = require('path');

// eslint-disable-next-line padding-line-between-statements
const exists = (path) => {
try {
statSync(path);

return true;
} catch (err) {
return false;
}
};
const resolveCodelyzerRulesDirectory = () => {
let packagePath = resolve(__dirname, '..', 'package.json');

while (exists(packagePath)) {
const codelyzerPath = resolve(dirname(packagePath), 'node_modules', 'codelyzer');

if (exists(codelyzerPath)) {
return codelyzerPath;
}

packagePath = resolve(packagePath, '..', '..', '..', 'package.json');
}
};

module.exports = {
extends: [
'rxjs-tslint-rules'
Expand Down Expand Up @@ -221,6 +194,6 @@ module.exports = {
]
},
rulesDirectory: [
resolveCodelyzerRulesDirectory()
'codelyzer'
]
};

0 comments on commit 0073404

Please sign in to comment.