-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
101 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 0 additions & 114 deletions
114
packages/stylelint-config-ali/test/rules-validate.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { readFile } from 'fs/promises'; | ||
import { join } from 'path'; | ||
import stylelint from 'stylelint'; | ||
import config from '../index'; | ||
|
||
describe('test/rules-validate.test.js', () => { | ||
it('Validate default', async () => { | ||
const result = await stylelint.lint({ | ||
config: config as any, | ||
code: await readFile(join(import.meta.dirname, 'fixtures/index.css'), 'utf-8'), | ||
fix: false, | ||
}); | ||
|
||
if (result && result.errored) { | ||
const filesResult = JSON.parse(result.report || '[]') || []; | ||
filesResult.forEach((fileResult) => { | ||
console.log(fileResult.warnings); | ||
}); | ||
|
||
expect(filesResult.length).toBeGreaterThan(0); | ||
} | ||
}); | ||
|
||
it('Validate sass', async () => { | ||
const result = await stylelint.lint({ | ||
config: config as any, | ||
code: await readFile(join(import.meta.dirname, 'fixtures/sass-test.scss'), 'utf-8'), | ||
fix: false, | ||
}); | ||
|
||
if (result && result.errored) { | ||
} | ||
console.log(result.results); | ||
expect(result.results.length).toBeGreaterThan(0); | ||
}); | ||
|
||
it('Validate less', async () => { | ||
const result = await stylelint.lint({ | ||
config: config as any, | ||
code: await readFile(join(import.meta.dirname, 'fixtures/less-test.less'), 'utf-8'), | ||
fix: false, | ||
}); | ||
|
||
if (result && result.errored) { | ||
const filesResult = JSON.parse(result.report || '[]') || []; | ||
filesResult.forEach((fileResult) => { | ||
console.log(fileResult.warnings); | ||
}); | ||
|
||
expect(filesResult.length).toBeGreaterThan(0); | ||
} | ||
}); | ||
|
||
it('Validate miniapp', async () => { | ||
const result = await stylelint.lint({ | ||
config: config as any, | ||
code: await readFile(join(import.meta.dirname, 'fixtures/miniapp.acss'), 'utf-8'), | ||
fix: false, | ||
}); | ||
|
||
if (result && result.errored) { | ||
const filesResult = JSON.parse(result.report || '[]') || []; | ||
filesResult.forEach((fileResult) => { | ||
console.log(fileResult.warnings); | ||
}); | ||
|
||
expect(filesResult.length).toBe(0); | ||
} | ||
}); | ||
|
||
it('Validate css-module', async () => { | ||
const result = await stylelint.lint({ | ||
config: config as any, | ||
code: await readFile(join(import.meta.dirname, 'fixtures/css-module.scss'), 'utf-8'), | ||
fix: false, | ||
}); | ||
|
||
if (result && result.errored) { | ||
const filesResult = JSON.parse(result.report || '[]') || []; | ||
filesResult.forEach((fileResult) => { | ||
console.log(fileResult.warnings); | ||
}); | ||
|
||
expect(filesResult.length).toBe(0); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2015", | ||
"module": "es2015", | ||
"moduleResolution": "node16", | ||
"jsx": "react-jsx" | ||
} | ||
"module": "esnext", | ||
"esModuleInterop": true, | ||
"resolveJsonModule": true, | ||
"types": ["node", "rive/globals"], | ||
"lib": ["esnext"], | ||
"allowJs": true, | ||
"checkJs": false, | ||
"skipLibCheck": true, | ||
"moduleResolution": "node", | ||
"isolatedModules": true | ||
}, | ||
"exclude": [".rive", "build", "coverage", "dist", "node_modules"] | ||
} |