Comments (2)
Basically something like this (but I guess in CoffeeScript):
'use strict';
var exists = require('fs').existsSync;
var pkg = require('./package.json');
if (pkg.main) {
checkFile(pkg.main);
}
if (pkg.bin) {
switch (typeof pkg.bin) {
case 'string':
checkFile(pkg.bin);
break;
case 'object':
Object.keys(pkg.bin).forEach(function (key) {
checkFile(pkg.bin[key]);
});
break;
}
}
function checkFile(file) {
if (!exists(file)) {
console.error('%s doesn\'t exist.', file);
}
}
Not sure if there are other fields in package.json that may point to specific paths, but those would probably be good to lint to, if any of this is a good idea.
from finepack.
I put this in the backlog for the next version :-)
from finepack.
Related Issues (19)
- Cannot find module 'superb' HOT 3
- Output looks the same with and without `-l` flag HOT 1
- Lint the JSON file for resolve common errors
- Ability to lint by file contents or Buffer instead of file HOT 3
- Data gets lost when using JSON.stringify() to display messages HOT 1
- Disable chalk colors when using API? HOT 4
- properties aren't being sorted HOT 3
- Verify file exists before trying to lint it HOT 2
- Validate license type? HOT 1
- Use npm validation
- Lint empty keywords
- Action required: Greenkeeper could not be activated 🚨
- An in-range update of acho-skin-cli is breaking the build 🚨 HOT 1
- An in-range update of acho is breaking the build 🚨 HOT 1
- Validate files field
- An in-range update of acho is breaking the build 🚨 HOT 1
- An in-range update of acho is breaking the build 🚨 HOT 1
- High severity dependency vulnerability: [email protected] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finepack.