Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lesslint

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lesslint - npm Package Compare versions

Comparing version 0.1.0-beta.2 to 0.1.0-beta.3

140

lib/checker.js

@@ -12,2 +12,4 @@ /**

var chalk = require('chalk');
/**

@@ -48,25 +50,3 @@ * less 检测的默认配置

var rcConfig = util.getConfig('.lesslintrc', file.path, defaultConfig);
// console.warn(rcConfig);
// fs.readdirSync(
// path.join(__dirname, 'visitor')
// ).forEach(
// function (name) {
// var key = name
// .replace(
// /(\-[a-z])/gi,
// function ($1) {
// return $1.toUpperCase().replace('-', '')
// }
// )
// .replace(/\.js$/, '');
// if (rcConfig[key]) {
// // 这个文件是肯定存在的,因为这里是以 lint 里的文件来循环的
// require(path.join(__dirname, 'visitor', name));
// }
// }
// )
// 当前检测文件的相对路径

@@ -97,3 +77,19 @@ var relativePath = edp.path.relative(process.cwd(), file.path);

if (err) {
console.log(err);
// console.log(file.path);
errors.push({
path: file.path,
messages: [
{
line: err.line,
message: ''
+ '`'
+ chalk.red('LESS Parse Error: ')
+ 'type: '
+ chalk.red(err.type)
+ '` '
+ chalk.grey(err.message)
}
]
});
done();
throw err;

@@ -123,103 +119,7 @@ }

// var newContent = JSON.parse(JSON.stringify(
// require('util').inspect(tree, { showHidden: true, depth: null }),
// null,
// 4
// )).replace(/","/g,'",\r\n"'); // 第三个参数代表分隔符
// //
// fs.writeFile(
// './temp.js',
// newContent,
// {
// encoding: 'utf8',
// flag: 'w'
// },
// function (e) {
// if (e) {
// throw e;
// }
// }
// );
// lesslintVisitor.exec(tree);
// var invalidList = lesslintVisitor.invalidList;
// if (invalidList.length) {
// errors.push({
// path: file.path,
// messages: invalidList
// });
// }
// done();
// try {
// tree.toCSS();
// }
// catch ( e ) {
// edp.log.error( e.toString() );
// }
// console.warn(lesslintVisitor);
// var sourceMap = require('source-map');
// fs.readFile(process.cwd() + '/33333.css.map', 'utf8', function (err, data) {
// if (err) {
// throw err;
// }
// // console.log(JSON.parse(data));
// var source_map = new sourceMap.SourceMapConsumer(data);
// console.warn(source_map);
// debugger
// console.log(source_map.originalPositionFor({
// column: 6,
// line: 5
// }));
// });
try {
tree.toCSS();
// var ensureDirectory = function (filepath) {
// var dir = path.dirname(filepath),
// cmd,
// existsSync = fs.existsSync || path.existsSync;
// if (!existsSync(dir)) {
// if (mkdirp === undefined) {
// try {mkdirp = require('mkdirp');}
// catch(e) { mkdirp = null; }
// }
// cmd = mkdirp && mkdirp.sync || fs.mkdirSync;
// cmd(dir);
// }
// };
// var opts = {
// sourceMap: '33333.css.map',
// sourceMapBasepath: process.cwd(),
// sourceMapFilename: '33333.css.map'
// }
// var writeSourceMap = function (output) {
// var filename = opts.sourceMapFullFilename || opts.sourceMap;
// ensureDirectory(filename);
// fs.writeFileSync(filename, output, 'utf8');
// };
// tree.toCSS({
// sourceMap: !!opts.sourceMap,
// sourceMapBasepath: process.cwd(),
// sourceMapFilename: opts.sourceMapFilename,
// writeSourceMap: writeSourceMap
// });
}
catch (e) {
// console.log(e);
console.log(e);
}

@@ -226,0 +126,0 @@ }

2

package.json
{
"name": "lesslint",
"description": "Lesslint your less code",
"version": "0.1.0-beta.2",
"version": "0.1.0-beta.3",
"maintainers": [

@@ -6,0 +6,0 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc