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

Support (package.json).eslintConfig.extends for special.eslint #154

Closed
vjpr opened this issue Jun 22, 2016 · 7 comments
Closed

Support (package.json).eslintConfig.extends for special.eslint #154

vjpr opened this issue Jun 22, 2016 · 7 comments
Labels

Comments

@vjpr
Copy link

vjpr commented Jun 22, 2016

http://eslint.org/docs/user-guide/configuring

@lijunle
Copy link
Member

lijunle commented Jun 22, 2016

Hi, @vjpr Are you referring to this support?

Configuration Files - use a JavaScript, JSON or YAML file to specify configuration information for an entire directory and all of its subdirectories. This can be in the form of an .eslintrc.* file or an eslintConfig field in a package.json file, both of which ESLint will look for and read automatically, or you can specify a configuration file on the command line.

@vjpr
Copy link
Author

vjpr commented Jun 22, 2016

Yep. Just saw #150 which looks like it covers it.

@vjpr vjpr closed this as completed Jun 22, 2016
@lijunle
Copy link
Member

lijunle commented Jun 22, 2016

I could make sure I understand you requirement. Are you writing the eslint config in the package.json file?

@vjpr
Copy link
Author

vjpr commented Jun 22, 2016

Yep.

function depcheckSpecialEslintPackageJson(content, filePath) {
  const filename = path.basename(filePath)
  if (filename === 'package.json') {
    const {eslintConfig} = JSON.parse(content)
    // TODO(vjpr): Use `special.eslint`'s built-in `extends` handling...
    if (eslintConfig.extends) {
      return ['eslint-config-' + eslintConfig.extends]
    }
  }
  return []
}

@lijunle
Copy link
Member

lijunle commented Jun 22, 2016

@vjpr Could you like to make some changes to eslint.js to get package.json support? I think the most logic for .eslintrc can be reused for your case.

@goloroden
Copy link

This is implemented by #173

@marcjordan
Copy link

Are we sure this was fixed? If I remove my .eslintrc file it doesn't appear to be looking at the config in package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants