lint-to-the-future-eslint
Advanced tools
Comparing version 0.2.0 to 0.2.1
11
main.js
@@ -1,2 +0,2 @@ | ||
const { readFileSync, writeFileSync } = require('fs'); | ||
const { readFileSync, writeFileSync, lstatSync } = require('fs'); | ||
const { join } = require('path'); | ||
@@ -61,9 +61,14 @@ const importCwd = require('import-cwd'); | ||
files.forEach((filePath) => { | ||
// prevent odd times when directories might end with `.js`; | ||
if (!lstatSync(filePath).isFile()) { | ||
return; | ||
} | ||
const file = readFileSync(filePath, 'utf8'); | ||
const firstLine = file.split('\n')[0]; | ||
if (!firstLine.includes('eslint-disable')) { | ||
if (!firstLine.includes('eslint-disable ')) { | ||
return; | ||
} | ||
const matched = firstLine.match(/eslint-disable(.*)\*\//); | ||
const matched = firstLine.match(/eslint-disable (.*)\*\//); | ||
const ignoreRules = matched[1].split(',').map(item => item.trim()); | ||
@@ -70,0 +75,0 @@ |
{ | ||
"name": "lint-to-the-future-eslint", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"@authmaker/generator-express:version": "3.2.6", | ||
@@ -5,0 +5,0 @@ "scripts": { |
4055
74