mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
@@ -15,6 +15,8 @@ export class Rule extends Lint.Rules.AbstractRule {
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
public static FAILURE_STRING_UNDERSCORE = 'The name of the File should not have _ in the name but you can use - ';
|
||||
public static FAILURE_STRING_UPPERCASE = 'The name of the File should not start with uppercase';
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
@@ -36,10 +38,21 @@ class AdfFileName extends Lint.RuleWalker {
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
|
||||
console.log('error');
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
|
||||
if (fileName.indexOf('-') >= 0) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING_UNDERSCORE + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
|
||||
if (fileName[0] == fileName[0].toUpperCase()) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING_UPPERCASE + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
}
|
||||
|
||||
private getFilename(): string {
|
||||
|
Reference in New Issue
Block a user