https://github.com/chee/detect-eslint-config
detect if a file is in a project that has an eslint config
https://github.com/chee/detect-eslint-config
Last synced: about 1 month ago
JSON representation
detect if a file is in a project that has an eslint config
- Host: GitHub
- URL: https://github.com/chee/detect-eslint-config
- Owner: chee
- License: gpl-3.0
- Created: 2022-02-03T20:42:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-05T01:20:53.000Z (almost 4 years ago)
- Last Synced: 2025-03-15T15:40:45.466Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# detect-eslint-config
detect if a file is in a project that has an eslint config
```sh
❯ npm i -D detect-eslint-config
```
use like:
```js
import detectEslintConfig from 'detect-eslint-config'
const hasEslintConfig = !!detectEslintConfig('dog/face')
if (hasEslintConfig) {
console.log('we have found an eslint config for this project')
}
```
it is synchronous and it does not check any further back than a `package.json`
should it find one.
if it does not find one it will stop at the disk root.
it will not check for config at the root of the disk. i hope that is okay.
## developing
```sh
❯ git clone git@github.com:chee/detect-eslint-config
❯ cd detect-eslint-config
❯ # edit source/index.js
❯ npm run build # me up buttercup
❯ npm run test
❯ git add -A
❯ git commit -m 'heHELLP'
❯ git push -f
❯ git rm -r *
❯ git commit -m 'pleas'
❯ git push -f
❯ git filter-branch --tree-filter 'git rm -rf * || echo um'
❯ git push -f
```
and a splendid time was guaranteed for all
## TODO
* get some eggs at the shop before it closes