eslint-plugin-pagecall-test
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "eslint-plugin-pagecall-test", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"main": "./dist/index.js", | ||
"dependencies": { | ||
"@typescript-eslint/experimental-utils": "^4.31.2", | ||
"path": "^0.12.7", | ||
"requireindex": "^1.2.0" | ||
@@ -9,0 +8,0 @@ }, |
import { ESLintUtils } from '@typescript-eslint/experimental-utils'; | ||
import path from 'path'; | ||
function parseFilename(filename: string) { | ||
var ext = path.extname(filename); | ||
return { | ||
dir: path.dirname(filename), | ||
base: path.basename(filename), | ||
ext: ext, | ||
name: path.basename(filename, ext), | ||
}; | ||
} | ||
const rule = ESLintUtils.RuleCreator(str => 'temp')({ | ||
@@ -18,4 +29,8 @@ defaultOptions: [], | ||
create: context => { | ||
const fileName = (context as any).getPhysicalFilename(); | ||
if (!fileName.includes('states/stores')) return {}; | ||
const root = context.options[1]; | ||
const filename = context.getFilename(); | ||
const absoluteFilename = path.resolve(filename); | ||
const parsed = parseFilename(absoluteFilename); | ||
const [, relativePath] = parsed.dir.split(root); | ||
if (relativePath.includes(`states\/stores`)) return {}; | ||
return { | ||
@@ -22,0 +37,0 @@ Identifier: node => { |
17981
2
67
- Removedpath@^0.12.7
- Removedinherits@2.0.3(transitive)
- Removedpath@0.12.7(transitive)
- Removedprocess@0.11.10(transitive)
- Removedutil@0.10.4(transitive)