Skip to content

Commit

Permalink
#683 Add pug-lint plugin to validate i18n tag usage (#960)
Browse files Browse the repository at this point in the history
* Install Acorn 7.3.1

* Add linter plugin for i18n tag usage

* Fix grunt exec:puglint not working on Windows

* Move the i18n pug-lint-vue plugin to ./scripts

* Bump Acorn to 8.0.1 and move it to devDependencies
  • Loading branch information
snowteamer authored Sep 7, 2020
1 parent 7076bba commit 2ed2525
Show file tree
Hide file tree
Showing 6 changed files with 570 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .Gruntfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module.exports = (grunt) => {
// https://github.com/standard/standard/issues/750#issuecomment-379294276
eslint: 'node ./node_modules/eslint/bin/eslint.js "**/*.{js,vue}"',
eslintgrunt: "./node_modules/.bin/eslint --ignore-pattern '!.*.js' .Gruntfile.babel.js Gruntfile.js",
puglint: './node_modules/.bin/pug-lint-vue frontend/views',
puglint: '"./node_modules/.bin/pug-lint-vue" frontend/views',
stylelint: 'node ./node_modules/stylelint/bin/stylelint.js "frontend/assets/style/**/*.{css,scss,vue}"',
flow: './node_modules/.bin/flow'
},
Expand Down
5 changes: 4 additions & 1 deletion .pug-lintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
},
"validateDivTags": true,
"validateIndentation": 2,
"validateSelfClosingTags": true
"validateSelfClosingTags": true,

"validateI18n": true,
"additionalRules": ["scripts/validate-i18n.js"]
}
14 changes: 11 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"@babel/preset-flow": "7.9.0",
"@babel/register": "7.9.0",
"@babel/runtime": "7.9.2",
"acorn": "8.0.1",
"babel-eslint": "10.1.0",
"babel-plugin-root-import": "6.5.0",
"babel-plugin-transform-inline-environment-variables": "0.4.3",
Expand Down
Loading

0 comments on commit 2ed2525

Please sign in to comment.