ember-template-lint
Advanced tools
Comparing version 0.5.2 to 0.5.3
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 @@ |
'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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
84392
3
46
2393
259
7
+ Addedlodash.assign@^4.0.8
+ Addedlodash.assign@4.2.0(transitive)
- Removedchalk@^1.1.1
- Removedjs-string-escape@^1.0.0
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedjs-string-escape@1.0.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)