eslint-plugin-nada
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -70,5 +70,6 @@ const _ = require('lodash'); | ||
create(context) { | ||
const filenameWithExt = context.getFilename(); | ||
const projectRoot = process.cwd(); | ||
const fullPathWithExt = context.getFilename(); | ||
const filenameWithExt = _.replace(fullPathWithExt, projectRoot, ''); | ||
const extension = path.extname(filenameWithExt); | ||
// const filename = path.basename(filenameWithExt, extension); | ||
const caseValue = _.get(context, 'options[0].case'); | ||
@@ -75,0 +76,0 @@ const ignoreParts = _.get(context, 'options[0].ignoreParts'); |
{ | ||
"name": "eslint-plugin-nada", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "enforces folder and file names to match desired case style", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -46,6 +46,8 @@ # eslint-plugin-nada | ||
First param is the severity level as per eslint standards, where: 0 = off, 1 = warn, 2 = error | ||
```json | ||
{ | ||
"rules": { | ||
"nada/path-case": [{"case": "kebabCase"}] | ||
"nada/path-case": [2, {"case": "kebabCase"}] | ||
} | ||
@@ -52,0 +54,0 @@ } |
@@ -12,2 +12,4 @@ /** | ||
process.cwd = () => '/systemRoot/myProjectFolder'; | ||
ruleTester.run('path-case', rule, { | ||
@@ -35,2 +37,7 @@ valid: [ | ||
}, | ||
{ | ||
filename: '/systemRoot/myProjectFolder/src/code/my-file-name-2.js', | ||
code: '//systemRoot/myProjectFolder/src/code/my-file-name-2\.js // rule: kebabCase', // eslint-disable-line | ||
options: [{ case: 'kebabCase' }], | ||
}, | ||
], | ||
@@ -37,0 +44,0 @@ |
14773
258
105