How to use the createLinter function from stylelint

Find comprehensive JavaScript stylelint.createLinter code examples handpicked from public code repositorys.

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, '..'),
  });
fork icon495
star icon593
watch icon0

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;
fork icon24
star icon370
watch icon0