Skip to content

Commit

Permalink
[33] Require a correct name in docs URL
Browse files Browse the repository at this point in the history
  • Loading branch information
constgen committed Nov 13, 2019
1 parent 5c8582d commit cbc26e7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .neutrinorc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'self/no-rerely-used-words': 'warn',
// 'self/no-special-in-object-members': 'warn',
'eslint-plugin/require-meta-docs-url': ['warn', {
// 'pattern': 'https://github.com/atomspace/eslint-plugin-naming-convention/blob/master/docs/rules/{{*}}.md'
'pattern': 'https://github.com/atomspace/eslint-plugin-naming-convention/blob/master/docs/rules/{{name}}.md'
}]
}
}
Expand Down
1 change: 1 addition & 0 deletions src/rules/latin-var-name-only/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./latin-var-name-only');
File renamed without changes.
30 changes: 1 addition & 29 deletions src/rules/no-rerely-used-words/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1 @@
let checkRerelyUsedWords = require('./check-rerely-used-words');

module.exports = {
meta: {
docs: {
url: 'https://github.com/atomspace/eslint-plugin-naming-convention/blob/master/docs/rules/no-rerely-used-words.md'
},
messages: {
noRerelyUsedWords: 'Avoid using rerely used words in identifiers.'
}
},
create (context) {
return {
Identifier (node) {
let isRerelyUsedWord = checkRerelyUsedWords(node.name);

if (isRerelyUsedWord) {
context.report({
node,
messageId: 'noRerelyUsedWords',
data: {
name: node.name
}
});
}
}
};
}
};
module.exports = require('./no-rerely-used-words');
29 changes: 29 additions & 0 deletions src/rules/no-rerely-used-words/no-rerely-used-words.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
let checkRerelyUsedWords = require('./check-rerely-used-words');

module.exports = {
meta: {
docs: {
url: 'https://github.com/atomspace/eslint-plugin-naming-convention/blob/master/docs/rules/no-rerely-used-words.md'
},
messages: {
noRerelyUsedWords: 'Avoid using rerely used words in identifiers.'
}
},
create (context) {
return {
Identifier (node) {
let isRerelyUsedWord = checkRerelyUsedWords(node.name);

if (isRerelyUsedWord) {
context.report({
node,
messageId: 'noRerelyUsedWords',
data: {
name: node.name
}
});
}
}
};
}
};
2 changes: 1 addition & 1 deletion test/latin-var-name-only.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const latinVarNameOnly = require('../src/rules/latin-var-name-only-rule');
const latinVarNameOnly = require('../src/rules/latin-var-name-only');

let RuleTester = require('eslint').RuleTester;

Expand Down

0 comments on commit cbc26e7

Please sign in to comment.