Skip to content

Commit

Permalink
Test: Master CSS ESLint Config is loaded correctly by ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Feb 26, 2024
1 parent fa5e37f commit 63bd733
Show file tree
Hide file tree
Showing 6 changed files with 3,475 additions and 352 deletions.
4 changes: 4 additions & 0 deletions packages/eslint-config/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('jest').Config} */
export default {
preset: '@techor/jest'
}
5 changes: 5 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"build": "techor build \"src/**/*.ts\"",
"dev": "pnpm build --watch",
"type-check": "tsc --noEmit",
"test": "jest",
"lint": "eslint src"
},
"keywords": [
Expand Down Expand Up @@ -48,5 +49,9 @@
},
"dependencies": {
"@master/eslint-plugin-css": "workspace:^"
},
"devDependencies": {
"@angular-eslint/template-parser": "^16.3.1",
"eslint": "^8.57.0"
}
}
11 changes: 11 additions & 0 deletions packages/eslint-config/tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: '@master/css',
overrides: [
{
'files': [
'*.html'
],
'parser': '@angular-eslint/template-parser'
}
]
}
4 changes: 4 additions & 0 deletions packages/eslint-config/tests/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="m:10 m:20 m:30 m:40@sm m:12x@sm">...</div>
<div class="font:12 font:24@sm m:32 block font:32@md mb:48">...</div>
<button class="btn">...</button>
<div class="bg:indigo width:">...</div>
8 changes: 8 additions & 0 deletions packages/eslint-config/tests/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ESLint } from 'eslint'

test('ESLint Configuration is valid', async () => {
const eslint = new ESLint({ cwd: __dirname })
const result = await eslint.lintFiles('./index.html')
expect(result[0].errorCount).toBe(1)
expect(result[0].warningCount).toBe(7)
})
Loading

0 comments on commit 63bd733

Please sign in to comment.