Skip to content

Commit

Permalink
[Rules] add meta.type for all rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ljqx committed Nov 18, 2018
1 parent 798eed7 commit 5101b73
Show file tree
Hide file tree
Showing 39 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/rules/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('default'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/dynamic-import-chunkname.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('dynamic-import-chunkname'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('export'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/exports-last.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function isNonExportStatement({ type }) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('exports-last'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function buildProperties(context) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('extensions'),
},
Expand Down
3 changes: 2 additions & 1 deletion src/rules/first.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('first'),
},
Expand Down Expand Up @@ -105,7 +106,7 @@ module.exports = {
insertSourceCode =
insertSourceCode.trim() + insertSourceCode.match(/^(\s+)/)[0]
}
insertFixer = lastLegalImp ?
insertFixer = lastLegalImp ?
fixer.insertTextAfter(lastLegalImp, insertSourceCode) :
fixer.insertTextBefore(body[0], insertSourceCode)
const fixers = [insertFixer].concat(removeFixers)
Expand Down
1 change: 1 addition & 0 deletions src/rules/group-exports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import docsUrl from '../docsUrl'

const meta = {
type: 'suggestion',
docs: {
url: docsUrl('group-exports'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/max-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const countDependencies = (dependencies, lastNode, context) => {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('max-dependencies'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/named.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('named'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('namespace'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/newline-after-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function isClassWithDecorator(node) {

module.exports = {
meta: {
type: 'layout',
docs: {
url: docsUrl('newline-after-import'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-absolute-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-absolute-path'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-amd'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-anonymous-default-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const defaults = Object.keys(defs)

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-anonymous-default-export'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const schemaObject = {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-commonjs'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-cycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import docsUrl from '../docsUrl'
// todo: cache cycles / deep relationships for faster repeat evaluation
module.exports = {
meta: {
type: 'suggestion',
docs: { url: docsUrl('no-cycle') },
schema: [makeOptionsSchema({
maxDepth:{
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-default-export.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
meta: {
type: 'suggestion',
docs: {},
},

Expand Down
1 change: 1 addition & 0 deletions src/rules/no-deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function getDeprecation(metadata) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-deprecated'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function checkImports(imported, context) {

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('no-duplicates'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-dynamic-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function isStaticValue(arg) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-dynamic-require'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-extraneous-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function testConfig(config, filename) {

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('no-extraneous-dependencies'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-internal-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-internal-modules'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-mutable-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-mutable-exports'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-named-as-default-member.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-named-as-default-member'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-named-as-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('no-named-as-default'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-named-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-named-default'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-named-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: { url: docsUrl('no-named-export') },
},

Expand Down
1 change: 1 addition & 0 deletions src/rules/no-namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-namespace'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-nodejs-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function reportIfMissing(context, node, allowed, name) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-nodejs-modules'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-relative-parent-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import importType from '../core/importType'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-relative-parent-imports'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-restricted-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('no-restricted-paths'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-self-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function isImportingSelf(context, node, requireName) {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'Forbid a module from importing itself',
recommended: true,
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-unassigned-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function create(context) {
module.exports = {
create,
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-unassigned-import'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-unresolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('no-unresolved'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-useless-path-segments.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const countRelParent = x => sumBy(x, v => v === '..')

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('no-useless-path-segments'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/no-webpack-loader-syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function reportIfNonStandard(context, node, name) {

module.exports = {
meta: {
type: 'problem',
docs: {
url: docsUrl('no-webpack-loader-syntax'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ function makeNewlinesBetweenReport (context, imported, newlinesBetweenImports) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('order'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/prefer-default-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('prefer-default-export'),
},
Expand Down
1 change: 1 addition & 0 deletions src/rules/unambiguous.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import docsUrl from '../docsUrl'

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: docsUrl('unambiguous'),
},
Expand Down

0 comments on commit 5101b73

Please sign in to comment.