Socket
Socket
Sign inDemoInstall

ember-template-lint

Package Overview
Dependencies
Maintainers
1
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-template-lint - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

test/unit/default-config-test.js

4

CHANGELOG.md
Changelog
=========
## v0.5.6
- Remove `bare-strings` from `recommended` configuration. See [#27](https://github.com/rwjblue/ember-template-lint/pull/27) for more details.
## v0.5.5

@@ -5,0 +9,0 @@

3

lib/config/recommended.js

@@ -5,3 +5,2 @@ 'use strict';

rules: {
'bare-strings': true,
'block-indentation': 2,

@@ -16,2 +15,2 @@ 'html-comments': true,

pending: []
};
};

@@ -7,2 +7,3 @@ 'use strict';

var chalk = require('chalk');
var rules = require('./rules');

@@ -65,2 +66,17 @@ var KNOWN_ROOT_PROPERTIES = ['extends', 'rules', 'pending'];

function validateRules(config, options) {
var logger = options.console || console;
var invalidKeysFound = [];
for (var key in config.rules) {
if (!rules[key]) {
invalidKeysFound.push(key);
}
}
if (invalidKeysFound.length > 0) {
logger.log(chalk.yellow('Invalid rule configuration found: ' + invalidKeysFound));
}
}
module.exports = function(options) {

@@ -71,5 +87,8 @@ var config = options.config || readConfigFromDisk(options);

migrateRulesFromRoot(config, options);
config = processExtends(config);
validateRules(config, options);
return config;
};
{
"name": "ember-template-lint",
"version": "0.5.5",
"version": "0.5.6",
"description": "Lint your templates.",

@@ -5,0 +5,0 @@ "scripts": {

@@ -37,7 +37,13 @@ # ember-template-lint

module.exports = {
extends: 'recommended'
extends: 'recommended',
rules: {
'bare-strings': true
}
}
```
This extends from the builtin recommended configuration ([lib/config/recommended.js](https://github.com/rwjblue/ember-template-lint/blob/master/lib/config/recommended.js)).
This extends from the builtin recommended configuration ([lib/config/recommended.js](https://github.com/rwjblue/ember-template-lint/blob/master/lib/config/recommended.js)),
and also enables the `bare-strings` rule (see [here](https://github.com/rwjblue/ember-template-lint#bare-strings)).
Using this mechanism allows you to extend from the builtin, and modify specific rules as needed.

@@ -271,2 +277,2 @@

* `npm test`
* `npm test`

@@ -100,2 +100,19 @@ var path = require('path');

});
});
it('warns for unknown rules', function() {
var message;
getConfig({
console: { log: function(_message) {
message = _message;
}},
config: {
rules: {
'blammo': true
}
}
});
assert(/Invalid rule configuration found/.test(message));
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc