Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: add url to each of the rules (refs #6582) #9788

Merged
merged 2 commits into from
Jan 5, 2018

Commits on Dec 28, 2017

  1. Docs: add url to each of the rules (refs eslint#6582)

    Code mod:
    
    export default function transformer(file, api) {
        const j = api.jscodeshift;
    
        const name = file.path.split('/').pop().replace(/.js$/, '');
    
        return j(file.source)
          .find(j.ObjectExpression)
          .filter(path => path.parentPath.node.key && path.parentPath.node.key.name === 'docs')
          .forEach(path => {
            const prop = j.property('init', j.identifier('url'), j.literal(`https://eslint.org/docs/rules/${name}`));
            j(path).replaceWith(j.objectExpression([...path.node.properties, prop]));
          })
          .toSource({lineTerminator: '\n'});
      }
    pmcelhaney authored and Patrick McElhaney committed Dec 28, 2017
    Configuration menu
    Copy the full SHA
    3a40794 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2017

  1. New: internal-rules/consistent-docs-url (refs eslint#6582)

    Add a lint rule to ensure that each rule has a meta.docs.url property with the correct value.
    Patrick McElhaney authored and Patrick McElhaney committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    215949b View commit details
    Browse the repository at this point in the history