Skip to content

Commit

Permalink
Merge pull request #1236 from ljqx/meta-type
Browse files Browse the repository at this point in the history
[Rules] add meta.type for all rules
  • Loading branch information
ljharb committed Dec 4, 2018
2 parents 798eed7 + 5101b73 commit 1cd82eb
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
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
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
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
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
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
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
@@ -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
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
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
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
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
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
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
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
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
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
@@ -1,5 +1,6 @@
module.exports = {
meta: {
type: 'suggestion',
docs: {},
},

Expand Down
1 change: 1 addition & 0 deletions src/rules/no-deprecated.js
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 1cd82eb

Please sign in to comment.