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

Add support for .cjs configs #909

Merged
merged 3 commits into from Oct 16, 2020
Merged

Add support for .cjs configs #909

merged 3 commits into from Oct 16, 2020

Conversation

mbrevda
Copy link
Contributor

@mbrevda mbrevda commented Sep 1, 2020

Add support for .cjs files

Background

cosmiconfig v7 added support for .cjs config files. This is useful in scenarios where the package is using es6 modules (e.g. package.json type parameter is set to module) but the config files are still in common js. Unfortionaltly, a config file ending with .cjs is not current supported:

# ls lint-staged*
lint-staged.config.cjs
# npx lint-staged  -d
  lint-staged:bin Running `lint-staged@10.2.13` +0ms
  lint-staged:bin Options parsed from command-line: {
  allowEmpty: false,
  concurrent: true,
  configPath: undefined,
  debug: true,
  maxArgLength: 131072,
  stash: true,
  quiet: false,
  relative: false,
  shell: false,
  verbose: false
} +1ms
  lint-staged Loading config using `cosmiconfig` +0ms
Config could not be found.

Please make sure you have created it correctly.
See https://github.com/okonet/lint-staged#configuration.

Prior Art

By way of example, Prettier added similar support here.

@codecov
Copy link

codecov bot commented Sep 1, 2020

Codecov Report

Merging #909 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #909   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines          608       608           
  Branches       143       143           
=========================================
  Hits           608       608           
Impacted Files Coverage Δ
lib/index.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67a4d06...3499a8d. Read the comment docs.

@mbrevda
Copy link
Contributor Author

mbrevda commented Sep 1, 2020

Thanks for the approval! How can we get this released?

@iiroj iiroj merged commit 36e7e58 into lint-staged:master Oct 16, 2020
@github-actions
Copy link
Contributor

🎉 This PR is included in version 10.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants