Skip to content

Commit

Permalink
fix template warn
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Aug 7, 2019
1 parent 9713595 commit 2aa5a46
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/unit/base-plugin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ describe('base plugin', function() {
exportedRules.forEach(ruleName => {
let pathName = `./../../lib/rules/lint-${ruleName}`;

if (!existsSync(join(__dirname, pathName + '.js'))) {
if (ruleName.startsWith('deprecated-')) {
pathName = `./../../lib/rules/deprecations/lint-${ruleName}`;
} else if (ruleName.startsWith('no-')) {
pathName = `./../../lib/rules/lint-${ruleName.replace('no-', '')}`;
}
if (ruleName.startsWith('deprecated-')) {
pathName = `./../../lib/rules/deprecations/lint-${ruleName}`;
}

expect(
defaultExport[ruleName],
`"${ruleName}" reexport must be referenced to "${pathName}"`
Expand All @@ -108,8 +105,8 @@ describe('base plugin', function() {
});

it('All files under docs/rule/ have a link from docs/rules.md.', function() {
const ruleFiles = readdirSync(join(__dirname, '../../docs/rule')).filter(name =>
name.endsWith('.md')
const ruleFiles = readdirSync(join(__dirname, '../../docs/rule')).filter(
name => name.endsWith('.md') && name !== '_TEMPLATE_.md'
);
const deprecatedRuleFiles = readdirSync(
join(__dirname, '../../docs/rule/deprecations')
Expand Down

0 comments on commit 2aa5a46

Please sign in to comment.