@o3r/stylelint-plugin
Version:
In-house stylelint plugin to use in your own eslint configuration
36 lines • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateAll = void 0;
const schematics_1 = require("@angular-devkit/schematics");
const schematics_2 = require("@o3r/schematics");
/**
* Rule to update the Stylelint configuration to new scope
* @param tree
* @param context
*/
const updateStyleLintConfig = (tree, context) => {
const excludes = ['**/node_modules/**', '**/.cache/**'];
const extensionMatcher = /stylelint.config\.[mc]?js$/;
const configFiles = (0, schematics_2.getAllFilesInTree)(tree, '/', excludes)
.filter((filePath) => extensionMatcher.test(filePath));
configFiles.forEach((file) => {
const text = tree.readText(file);
if (text.includes('@o3r/stylelint-plugin')) {
context.logger.debug(`Update ${file}`);
tree.overwrite(file, text
.replaceAll(/@o3r\/stylelint-plugin/g, '@ama-styling/stylelint-plugin')
.replaceAll(/o3r-/g, 'ama-'));
}
});
};
/**
* Update of Otter library V13.0
*/
exports.updateAll = (0, schematics_2.createOtterSchematic)(() => (0, schematics_1.chain)([
updateStyleLintConfig,
(_, context) => {
context.logger.warn('The package "@o3r/stylelint-plugin" is deprecated, please install "@ama-styling/stylelint-plugin" with the following command:');
context.logger.warn('ng add @ama-styling/stylelint-plugin');
}
]));
//# sourceMappingURL=index.js.map