diff --git a/grep-lint.py b/grep-lint.py index ddc235214f..aa78da6d18 100644 --- a/grep-lint.py +++ b/grep-lint.py @@ -9,6 +9,7 @@ def get_command(branch=None): arguments_list.append("--") arguments_list.append("scripts") + arguments_list.append("./package.json") return arguments_list @@ -43,6 +44,13 @@ def get_command(branch=None): 'perl_regex': 'template\s*?:\s*[\'|"|`][^\'|"|`]*<[^\'|"|`]*[\'|"|`]', 'tolerance': True }, + { + 'name': 'force exact ui-framework version', + + # errors if finds a caret or a tilde next to ui-framework version + 'perl_regex': '"superdesk-ui-framework": "(\^|~)', + 'tolerance': False + }, ] any_rule_violated = False diff --git a/package.json b/package.json index 80cb7d73cc..2d495c0fad 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "sass-loader": "6.0.6", "shortid": "2.2.8", "style-loader": "0.20.2", - "superdesk-ui-framework": "^4.0.4", + "superdesk-ui-framework": "4.0.4", "ts-loader": "3.5.0", "typescript": "4.9.5", "uuid": "8.3.1", @@ -163,7 +163,7 @@ "test": "npm run lint && npm run unit && node tasks/verify-client-api-changes.js", "debug-unit-tests": "karma start --reporters=progress --browsers=Chrome", "unit": "karma start --single-run", - "lint": "tsc -p scripts --noEmit && eslint --quiet --parser=@typescript-eslint/parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts e2e/client tasks", + "lint": "python ./grep-lint.py && tsc -p scripts --noEmit && eslint --quiet --parser=@typescript-eslint/parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts e2e/client tasks", "lint-fix": "eslint --fix --parser=@typescript-eslint/parser --ext .js --ext .jsx --ext .ts --ext .tsx scripts e2e/client tasks", "server": "grunt server", "dev": "npm run server"