Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upInherit standard configuration from parent package.json #580
Comments
dcousens
added
the
feature request
label
Jul 28, 2016
This comment has been minimized.
This comment has been minimized.
|
This sounds reasonable to me. We currently use |
This comment has been minimized.
This comment has been minimized.
|
Babel uses its own custom "config chain". |
feross
modified the milestone:
standard v9
Aug 19, 2016
feross
modified the milestones:
standard v10,
standard v9
Feb 9, 2017
feross
modified the milestones:
standard v11,
standard v10
Mar 2, 2017
feross
added
enhancement
and removed
enhancement
enhancement2
labels
May 10, 2018
feross
modified the milestones:
standard v12,
standard v13
Aug 28, 2018
feross
modified the milestones:
standard v13,
standard v14
Jul 5, 2019
feross
modified the milestones:
standard 14,
standard 15
Aug 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
timoxley commentedJul 28, 2016
•
edited
Problem
standardcurrently does not check directories abovecwdfor package.json files containing standard configuration.Example
Say I have
A&A/Bdirectories, both with their ownpackage.jsonfiles:A ├── package.json ├── index.js └── B ├── package.json └── index.jsLet's suppose
B/index.jscontains some syntax that requires thebabel-eslintparser:standardwill behave differently depending on what the current directory is:At first, not reading parent directories for configuration does seem like reasonable behaviour, though it differs from that of babel, which finds all the configs in all parents, then merges the results:
https://github.com/babel/babel/blob/210c3f7da92a7bd9b6da8fb57dac38996222fecd/packages/babel-core/src/transformation/file/options/build-config-chain.js#L26
While
standardappears to just find the nearestpackage.jsonwhether it has a "standard" config or not: https://github.com/Flet/standard-engine/blob/9ddbe6cce2dd43f3d888b64aede48ef3190d2e34/index.js#L136Proposal
I suggest
standardshould follow the lead ofbabelhere and inherit parent configs. I'd be happy if it just searched up until it found the first "standard" config, but I think perhaps a "standard" for config behaviour across all tools that read config from package.json/.rc files is better than minimalism. Ideally a reusable package could be used for keeping this consistent.