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.2 to 0.5.3

lib/config/recommended.js

11

CHANGELOG.md
Changelog
=========
## v0.5.3
- Add ability to extend from internally managed configurations.
- Add `recommended` configuration, which can be used via the following in your `.template-lintrc.js`:
```js
module.exports = {
extends: 'recommended'
}
```
## v0.5.2

@@ -5,0 +16,0 @@

31

lib/get-config.js
'use strict';
/*eslint no-console: [0] */
var path = require('path');
var assign = require('lodash.assign');
var existsSync = require('exists-sync');
var chalk = require('chalk');
function buildDefaultConfig(console) {
console.log(chalk.yellow('\nember-cli-template-lint requires a configuration file to enable rules. Please generate one with `ember generate ember-cli-template-lint`.'));
function readConfigFromDisk(options) {
var providedConfigPath = options.configPath;
var configPath = providedConfigPath || path.join(process.cwd(), '.template-lintrc');
return {};
}
module.exports = function(console, templatercPath) {
var defaultConfigPath = templatercPath || path.join(process.cwd(), '.template-lintrc');
var overrideConfigPath = process.env['TEMPLATE_LINTRC'];
var configPath = overrideConfigPath || defaultConfigPath;
if(existsSync(configPath) || existsSync(configPath + '.js') || existsSync(configPath + '.json')) {
return require(configPath);
} else {
return buildDefaultConfig(console);
return {};
}
}
module.exports = function(options) {
var config = options.config || readConfigFromDisk(options);
if (config.extends) {
var extendingConfig = require('./config/' + config.extends);
config = assign({}, extendingConfig, config);
delete config.extends;
}
return config;
};
var compile = require('htmlbars').compile;
var plugins = require('../ext/plugins');
var plugins = require('./rules');
var getConfig = require('./get-config');

@@ -21,3 +21,3 @@

} else {
this.config = getConfig(this.console, this.options.configPath);
this.config = getConfig(this.options);
}

@@ -24,0 +24,0 @@ },

The MIT License (MIT)
Copyright (c) 2016
Copyright (c) 2016 Robert Jackson and contributors

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{
"name": "ember-template-lint",
"version": "0.5.2",
"version": "0.5.3",
"description": "Lint your templates.",

@@ -33,6 +33,5 @@ "scripts": {

"dependencies": {
"chalk": "^1.1.1",
"exists-sync": "0.0.3",
"htmlbars": "^0.14.17",
"js-string-escape": "^1.0.0"
"lodash.assign": "^4.0.8"
},

@@ -39,0 +38,0 @@ "bugs": {

@@ -1,2 +0,2 @@

# ember-cli-template-lint
# ember-template-lint

@@ -37,6 +37,9 @@ [![Build Status](https://travis-ci.org/rwjblue/ember-template-lint.svg?branch=master)](https://travis-ci.org/rwjblue/ember-template-lint)

module.exports = {
'bare-strings': false
extends: 'recommended'
}
```
This extends from the builtin recommended configuration ([lib/config/recommended.js](https://github.com/rwjblue/ember-template-lint/blob/master/lib/config/recommended.js)).
Using this mechanism allows you to extend from the builtin, and modify specific rules as needed.
Some rules also allow setting additional configuration, for example if you would like to configure

@@ -43,0 +46,0 @@ some "bare strings" that are allowed you might have:

@@ -5,4 +5,4 @@ 'use strict';

var _compile = require('htmlbars').compile;
var buildPlugin = require('./../../ext/plugins/base');
var ast = require('./../../ext/helpers/ast-node-info');
var buildPlugin = require('./../../lib/rules/base');
var ast = require('./../../lib/helpers/ast-node-info');

@@ -9,0 +9,0 @@ describe('base plugin tests', function() {

'use strict';
var generateRuleTests = require('../../../helpers/rule-test-harness');
var DEPRECATION_URL = require('../../../../ext/plugins/deprecations/lint-deprecated-each-syntax').DEPRECATION_URL;
var DEPRECATION_URL = require('../../../../lib/rules/deprecations/lint-deprecated-each-syntax').DEPRECATION_URL;

@@ -6,0 +6,0 @@ var message = 'Deprecated {{#each}} usage. See the deprecation guide at ' + DEPRECATION_URL;

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