diff --git a/.neutrinorc.js b/.neutrinorc.js index 5992473..39d991d 100644 --- a/.neutrinorc.js +++ b/.neutrinorc.js @@ -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' }] } } diff --git a/src/rules/latin-var-name-only-rule/closest-latin-to-cyrrilic-char-similarity.js b/src/rules/latin-var-name-only/closest-latin-to-cyrrilic-char-similarity.js similarity index 100% rename from src/rules/latin-var-name-only-rule/closest-latin-to-cyrrilic-char-similarity.js rename to src/rules/latin-var-name-only/closest-latin-to-cyrrilic-char-similarity.js diff --git a/src/rules/latin-var-name-only/index.js b/src/rules/latin-var-name-only/index.js new file mode 100644 index 0000000..228d70e --- /dev/null +++ b/src/rules/latin-var-name-only/index.js @@ -0,0 +1 @@ +module.exports = require('./latin-var-name-only'); \ No newline at end of file diff --git a/src/rules/latin-var-name-only-rule/index.js b/src/rules/latin-var-name-only/latin-var-name-only.js similarity index 100% rename from src/rules/latin-var-name-only-rule/index.js rename to src/rules/latin-var-name-only/latin-var-name-only.js diff --git a/src/rules/no-rerely-used-words/index.js b/src/rules/no-rerely-used-words/index.js index 9b7bac5..0c8759e 100644 --- a/src/rules/no-rerely-used-words/index.js +++ b/src/rules/no-rerely-used-words/index.js @@ -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 - } - }); - } - } - }; - } -}; \ No newline at end of file +module.exports = require('./no-rerely-used-words'); \ No newline at end of file diff --git a/src/rules/no-rerely-used-words/no-rerely-used-words.js b/src/rules/no-rerely-used-words/no-rerely-used-words.js new file mode 100644 index 0000000..9b7bac5 --- /dev/null +++ b/src/rules/no-rerely-used-words/no-rerely-used-words.js @@ -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 + } + }); + } + } + }; + } +}; \ No newline at end of file diff --git a/test/latin-var-name-only.test.js b/test/latin-var-name-only.test.js index 9ec6e68..20a30f2 100644 --- a/test/latin-var-name-only.test.js +++ b/test/latin-var-name-only.test.js @@ -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;