How to use the createLinter function from stylelint
Find comprehensive JavaScript stylelint.createLinter code examples handpicked from public code repositorys.
GitHub: learningequality/kolibri
54 55 56 57 58 59 60 61 62 63
// Initialize a stylelint linter for each style file type that we support // Create them here so that we can reuse, rather than creating many many objects. const styleLangs = ['scss', 'css', 'less']; const styleLinters = {}; styleLangs.forEach(lang => { styleLinters[lang] = stylelint.createLinter({ config: stylelintConfig, fix: true, configBasedir: path.resolve(__dirname, '..'), });
495
593
0
27 28 29 30 31 32 33 34 35 36 37 38
throw new Error(`Could not get config for file: ${resolvedPath}`); } async function check(path) { const resolvedPath = resolve(process.cwd(), path || ''); const linter = stylelint.createLinter(); const config = await getConfig(linter, resolvedPath); const prettierRules = stylelintConfigPrettier.rules; const configRules = config.config.rules;
24
370
0
stylelint.utils is the most popular function in stylelint (206 examples)