Skip to content

Commit

Permalink
Merge branch 'master' into ensuring-new-rule-setup-is-correct
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart authored Aug 7, 2019
2 parents e5bd788 + a6b2d0d commit 9713595
Show file tree
Hide file tree
Showing 77 changed files with 5,151 additions and 869 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ before_install:
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install
- yarn install --ignore-engines

script:
- yarn test
Expand All @@ -33,7 +33,7 @@ jobs:

- stage: additional tests
name: floating dependencies
install: yarn install --no-lockfile
install: yarn install --no-lockfile --ignore-engines

- name: "Node 6"
node_js: "6"
Expand Down
127 changes: 125 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,128 @@
Changelog
=========
## v1.5.1 (2019-08-06)

#### :rocket: Enhancement
* [#790](https://github.com/ember-template-lint/ember-template-lint/pull/790) Add "octane" configuration preset. ([@rwjblue](https://github.com/rwjblue))

#### :bug: Bug Fix
* [#796](https://github.com/ember-template-lint/ember-template-lint/pull/796) Allow `{{#-in-element}}` and `{{#in-element}}` for `no-curly-component-invocation` rule ([@mydea](https://github.com/mydea))
* [#791](https://github.com/ember-template-lint/ember-template-lint/pull/791) Ensure table-group rule allows `each`, `each-in`, `let`, and comments ([@mongoose700](https://github.com/mongoose700))

#### Committers: 4
- Bryan Mishkin ([@bmish](https://github.com/bmish))
- Francesco Novy ([@mydea](https://github.com/mydea))
- Michael Peirce ([@mongoose700](https://github.com/mongoose700))
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))

## v1.5.0 (2019-07-31)

#### :rocket: Enhancement
* [#768](https://github.com/ember-template-lint/ember-template-lint/pull/768) Add no-curly-component-invocation rule ([@patocallaghan](https://github.com/patocallaghan))

#### :bug: Bug Fix
* [#788](https://github.com/ember-template-lint/ember-template-lint/pull/788) Add support for handling `<button tabindex={{if this.foo 0 -1}}><button>` to no-positive-tabindex rule ([@lifeart](https://github.com/lifeart))
* [#779](https://github.com/ember-template-lint/ember-template-lint/pull/779) Allow <img onload={{action 'foo'}}> in no-invalid-interactive rule ([@joankaradimov](https://github.com/joankaradimov))
* [#762](https://github.com/ember-template-lint/ember-template-lint/pull/762) Ensure no-outlet-outside-routes allows apps or routes named "components" ([@marcoow](https://github.com/marcoow))

#### :memo: Documentation
* [#775](https://github.com/ember-template-lint/ember-template-lint/pull/775) Add rule documentation to missing rule to docs/rules.md. ([@bmish](https://github.com/bmish))

#### Committers: 5
- Alex Kanunnikov ([@lifeart](https://github.com/lifeart))
- Bryan Mishkin ([@bmish](https://github.com/bmish))
- Joan Karadimov ([@joankaradimov](https://github.com/joankaradimov))
- Marco Otte-Witte ([@marcoow](https://github.com/marcoow))
- Pat O'Callaghan ([@patocallaghan](https://github.com/patocallaghan))

## v1.4.0 (2019-07-12)

#### :rocket: Enhancement
* [#759](https://github.com/ember-template-lint/ember-template-lint/pull/759) Deprecate `img-alt-attributes` rule in favor of `require-valid-alt-text` ([@bmish](https://github.com/bmish))
* [#753](https://github.com/ember-template-lint/ember-template-lint/pull/753) Add `no-unnecessary-component-helper` rule ([@bmish](https://github.com/bmish))
* [#518](https://github.com/ember-template-lint/ember-template-lint/pull/518) Add blacklist support to simple-unless rule ([@mattbalmer](https://github.com/mattbalmer))

#### :bug: Bug Fix
* [#772](https://github.com/ember-template-lint/ember-template-lint/pull/772) Fix `no-element-event-actions` rule to ignore case when checking the DOM event attribute name (should handle either `onclick` or `ONCLICK`) ([@bmish](https://github.com/bmish))
* [#773](https://github.com/ember-template-lint/ember-template-lint/pull/773) Fix `no-invalid-interactive` rule to consider any DOM event attribute usage as adding interactivity to an element ([@bmish](https://github.com/bmish))

#### Committers: 3
- Bryan Mishkin ([@bmish](https://github.com/bmish))
- Matt Balmer ([@mattbalmer](https://github.com/mattbalmer))
- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)

## v1.3.0 (2019-06-19)

#### :rocket: Enhancement
* [#742](https://github.com/ember-template-lint/ember-template-lint/pull/742) Update `table-groups` rule to allow `{{#some-component tagName="tbody"}}{{/some-component}}` to be a child of `table` ([@bmish](https://github.com/bmish))

#### :bug: Bug Fix
* [#750](https://github.com/ember-template-lint/ember-template-lint/pull/750) Ensure custom rules can be disabled with inline comments. ([@rwjblue](https://github.com/rwjblue))

#### :memo: Documentation
* [#744](https://github.com/ember-template-lint/ember-template-lint/pull/744) Tweak error message for `no-element-event-actions` rule. ([@bmish](https://github.com/bmish))
* [#740](https://github.com/ember-template-lint/ember-template-lint/pull/740) Fix rule ordering and incorrect rule name in plugin documentation ([@bmish](https://github.com/bmish))

#### :house: Internal
* [#738](https://github.com/ember-template-lint/ember-template-lint/pull/738) Add support for new node types to the AST ([@CvX](https://github.com/CvX))

#### Committers: 4
- Bryan Mishkin ([@bmish](https://github.com/bmish))
- Jarek Radosz ([@CvX](https://github.com/CvX))
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))
- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)

## v1.2.0 (2019-06-12)

#### :rocket: Enhancement
* [#733](https://github.com/ember-template-lint/ember-template-lint/pull/733) Add new rule: `no-obsolete-elements` ([@MelSumner](https://github.com/MelSumner))
* [#714](https://github.com/ember-template-lint/ember-template-lint/pull/714) Expose rule test harness for use by custom rule authors. ([@gabrielcsapo](https://github.com/gabrielcsapo))
* [#631](https://github.com/ember-template-lint/ember-template-lint/pull/631) Add rule: [A11y] `require-iframe-title` ([@lifeart](https://github.com/lifeart))
* [#681](https://github.com/ember-template-lint/ember-template-lint/pull/681) Update `table-groups` rule to allow `{{yield}}` inside `<table>` ([@sohara](https://github.com/sohara))
* [#633](https://github.com/ember-template-lint/ember-template-lint/pull/633) Add rule: [A11y] `no-positive-tabindex` ([@lifeart](https://github.com/lifeart))
* [#624](https://github.com/ember-template-lint/ember-template-lint/pull/624) Add rule: [A11y]`require-valid-alt-text` ([@lifeart](https://github.com/lifeart))
* [#628](https://github.com/ember-template-lint/ember-template-lint/pull/628) Add rule: [A11y] `no-abstract-roles` ([@lifeart](https://github.com/lifeart))
* [#721](https://github.com/ember-template-lint/ember-template-lint/pull/721) Allow `{{some-component tagName="tbody"}}` to be a child of a `table` ([@raycohen](https://github.com/raycohen))
* [#672](https://github.com/ember-template-lint/ember-template-lint/pull/672) Add `allowDynamicStyles` option to `no-inline-styles` lint rule ([@bmish](https://github.com/bmish))
* [#638](https://github.com/ember-template-lint/ember-template-lint/pull/638) Update `table-groups` rule to allow comments inside `<table>` ([@lifeart](https://github.com/lifeart))
* [#614](https://github.com/ember-template-lint/ember-template-lint/pull/614) Add rule: `no-element-event-actions` ([@bmish](https://github.com/bmish))

#### :bug: Bug Fix
* [#737](https://github.com/ember-template-lint/ember-template-lint/pull/737) Allow `onerror` for `img` elements in `no-invalid-interactive` rule ([@elidupuis](https://github.com/elidupuis))
* [#730](https://github.com/ember-template-lint/ember-template-lint/pull/730) Ensure console output is completed before exiting `ember-template-lint` executable ([@john-kurkowski](https://github.com/john-kurkowski))
* [#709](https://github.com/ember-template-lint/ember-template-lint/pull/709) Update `@glimmer/compiler` to avoid errors when forwarding element modifiers to component invocations ([@dmzza](https://github.com/dmzza))
* [#639](https://github.com/ember-template-lint/ember-template-lint/pull/639) Fix `no-bare-strings` to allow whitelisting empty string ([@lifeart](https://github.com/lifeart))
* [#618](https://github.com/ember-template-lint/ember-template-lint/pull/618) Allow `{{else}} {{#unless ...}}` in the `simple-unless` and `no-negated-condition` rules ([@bmish](https://github.com/bmish))
* [#613](https://github.com/ember-template-lint/ember-template-lint/pull/613) Avoid suggesting `unless` with helpers in condition in `no-negated-condition` rule ([@bmish](https://github.com/bmish))

#### :memo: Documentation
* [#678](https://github.com/ember-template-lint/ember-template-lint/pull/678) Add documentation on how to ignore modules when using ember-template-lint and ember-cli-template-lint together ([@DingoEatingFuzz](https://github.com/DingoEatingFuzz))
* [#695](https://github.com/ember-template-lint/ember-template-lint/pull/695) Fixed 404 URL in `sourceForNode` comment ([@kevinansfield](https://github.com/kevinansfield))
* [#686](https://github.com/ember-template-lint/ember-template-lint/pull/686) Fix link to spec in `self-closing-void-elements` documentation ([@woprandi](https://github.com/woprandi))
* [#675](https://github.com/ember-template-lint/ember-template-lint/pull/675) Add allowed example to `no-bare-strings` rule documentation ([@bmish](https://github.com/bmish))
* [#671](https://github.com/ember-template-lint/ember-template-lint/pull/671) Add command for generating pending list to README ([@TristanToye](https://github.com/TristanToye))
* [#670](https://github.com/ember-template-lint/ember-template-lint/pull/670) Fix a typo in the `style-concatenation` rule documentation ([@dmzza](https://github.com/dmzza))
* [#652](https://github.com/ember-template-lint/ember-template-lint/pull/652) Update documentation to show `no-element-event-actions` and `no-action-modifiers` as related rules ([@keanedawg](https://github.com/keanedawg))
* [#641](https://github.com/ember-template-lint/ember-template-lint/pull/641) Add template for writing documentation for new rules ([@bmish](https://github.com/bmish))

#### :house: Internal
* [#627](https://github.com/ember-template-lint/ember-template-lint/pull/627) Add `-test` suffix to some test files that were not running in CI ([@bmish](https://github.com/bmish))

#### Committers: 16
- Alex Kanunnikov ([@lifeart](https://github.com/lifeart))
- Bryan Mishkin ([@bmish](https://github.com/bmish))
- Cameron Fife ([@keanedawg](https://github.com/keanedawg))
- David Mazza ([@dmzza](https://github.com/dmzza))
- Eli Dupuis ([@elidupuis](https://github.com/elidupuis))
- Gabriel Csapo ([@gabrielcsapo](https://github.com/gabrielcsapo))
- John Kurkowski ([@john-kurkowski](https://github.com/john-kurkowski))
- Kevin Ansfield ([@kevinansfield](https://github.com/kevinansfield))
- Melanie Sumner ([@MelSumner](https://github.com/MelSumner))
- Michael Lange ([@DingoEatingFuzz](https://github.com/DingoEatingFuzz))
- Ray Cohen ([@raycohen](https://github.com/raycohen))
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))
- Sean O'Hara ([@sohara](https://github.com/sohara))
- Tristan Toye ([@TristanToye](https://github.com/TristanToye))
- William Oprandi ([@woprandi](https://github.com/woprandi))
- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview)

## v1.1.0 (2019-01-16)

Expand Down
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,11 @@ The following properties are allowed in the root of the `.template-lintrc.js` co
An array of module id's that are still pending. The goal of this array is to allow incorporating template linting
into an existing project, without changing every single template file. You can add all existing templates to this `pending` listing
and slowly work through them, while at the same time ensuring that new templates added to the project pass all defined rules.
* If you are using `ember-cli-template-lint` you can generate this list with: `ember template-lint:print-failing`
* `ignore` -- `string[]|glob[]`
An array of module id's that are to be completely ignored.
An array of module id's that are to be completely ignored. See [ignore documentation](docs/ignore.md) for more details.
* `plugins` -- `(string|Object)[]`
An array of plugin objects, or strings that resolve to files that export plugin objects. See [plugin documentation](docs/plugins.md) for more details.

You can ignore individual files or directories.

```javascript
module.exports = {
extends: 'recommended',

ignore: [
'./node_modules/**',
'./vendor/**',
'app-name/templates/login'
]
};
```

## Rules

Expand Down
41 changes: 41 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Release

Releases are mostly automated using
[release-it](https://github.com/release-it/release-it/) and
[lerna-changelog](https://github.com/lerna/lerna-changelog/).


## Preparation

Since the majority of the actual release process is automated, the primary
remaining task prior to releasing is confirming that all pull requests that
have been merged since the last release have been labeled with the appropriate
`lerna-changelog` labels and the titles have been updated to ensure they
represent something that would make sense to our users. Some great information
on why this is important can be found at
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
guiding principles here is that changelogs are for humans, not machines.

When reviewing merged PR's the labels to be used are:

* breaking - Used when the PR is considered a breaking change.
* enhancement - Used when the PR adds a new feature or enhancement.
* bug - Used when the PR fixes a bug included in a previous release.
* documentation - Used when the PR adds or updates documentation.
* internal - Used for internal changes that still require a mention in the
changelog/release notes.


## Release

Once the prep work is completed, the actual release is straight forward:

```
yarn install
yarn release
```

The `release` script leverages
[release-it](https://github.com/release-it/release-it/) to do the mechanical
release process. It will prompt you through the process of choosing the version
number, tagging, pushing the tag and commits, etc.
6 changes: 1 addition & 5 deletions bin/ember-template-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ function checkConfigPath() {
}

function run() {
var exitCode = 0;

var configPath = checkConfigPath();
var linter;
try {
Expand All @@ -111,15 +109,13 @@ function run() {
return err.severity > 1;
})
)
exitCode = 1;
process.exitCode = 1;

if (fileErrors.length) errors[filePath] = fileErrors;
return errors;
}, {});

if (Object.keys(errors).length) printErrors(errors);
// eslint-disable-next-line no-process-exit
if (exitCode) return process.exit(exitCode);
}

run();
35 changes: 35 additions & 0 deletions docs/ignore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Ignore support

You can tell the linter to ignore individual files or entire directories with the `ignore` option.

The ignore option takes an array of strings that either match exact modules or glob-match multiple modules.

* **module** -- `'app/templates/exceptional-page'`
* **glob** -- `'app/templates/components/odd-ones/**'`

### Sample configuration

```javascript
module.exports = {
extends: 'recommended',

ignore: [
'project-name/templates/login',
'project-name/templates/components/odd-ones/**',
'app/templates/login',
'app/templates/components/odd-ones/**',
]
};
```

### Why are patterns duplicated?

You may have noticed in the sample configuration that the four patterns are actually two patterns repeated with different prefixes.

This is because `ember-template-lint` works directly with the filesystem and is not aware
of the applications module prefix, however `ember-cli-template-lint` works within the build
pipeline of your application which is not aware of the original file paths since all modules
are within your applications module prefix by the time it is ran.
**_tldr;_** The `app/...` patterns match the filesystem (app directory). The `project-name/...` patterns match Ember's resolver (`ENV.modulePrefix` in `config/environment.js`).

After [Module Unification](https://github.com/emberjs/ember.js/issues/16373), Ember's internal resolver will match the filesystem, so ignore patterns will no longer need to be repeated.
53 changes: 53 additions & 0 deletions docs/rule/_TEMPLATE_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## (rule name goes here)

(context about the problem goes here)

(what the rule does goes here)

### Examples

This rule **forbids** the following:

```hbs
{{! Example 1 }}
```

```hbs
{{! Example 2 }}
```

This rule **allows** the following:

```hbs
{{! Example 1 }}
```

```hbs
{{! Example 2 }}
```

### Migration

(suggest any fast/automated techniques for fixing violations in a large codebase)

* suggestion on how to fix violations using find-and-replace / regexp
* suggestion on how to fix violations using a codemod

### Configuration

(exclude this section if the rule has no extra configuration)

* object -- containing the following properties:
* string -- `parameterName1` -- description of parameter including the possible values and default value
* boolean -- `parameterName2` -- description of parameter including the possible values and default value

### Related Rules

* [related-rule-name1](related-rule-name1.md)
* [related-rule-name2](related-rule-name2.md)

### References

* (link to relevant documentation goes here)
* (link to relevant function spec goes here)
* (link to relevant guide goes here)
2 changes: 2 additions & 0 deletions docs/rule/img-alt-attributes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## img-alt-attributes

**NOTE**: This rule is deprecated in favor of the more comprehensive rule [require-valid-alt-text](./require-valid-alt-text.md).

An `<img>` without an `alt` attribute is essentially invisible to assistive/accessibility technology (i.e. screen readers).
In order to ensure that screen readers can provide useful information, we need to ensure that all `<img>` elements
have an `alt` attribute specified.
Expand Down
33 changes: 33 additions & 0 deletions docs/rule/no-abstract-roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## no-abstract-roles

The HTML attribute `role` must never have the following values:

* `command`
* `composite`
* `input`
* `landmark`
* `range`
* `roletype`
* `section`
* `sectionhead`
* `select`
* `structure`
* `widget`
* `window`

### `<* role>`

This rule **forbids** the following:

```hbs
<div role="window"> Hello, world! </div>
```

This rule **allows** the following:

```hbs
<div role="button"> Push it </div>
```

### References
* See [https://www.w3.org/TR/wai-aria-1.0/roles#abstract_roles](https://www.w3.org/TR/wai-aria-1.0/roles#abstract_roles)
4 changes: 4 additions & 0 deletions docs/rule/no-action-modifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ The following values are valid configuration:

* boolean -- `true` for enabled / `false` for disabled
* array -- an array of whitelisted element tag names, which will accept action modifiers

### Related Rules

* [no-element-event-actions](no-element-event-actions.md)
7 changes: 7 additions & 0 deletions docs/rule/no-bare-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ This rule **forbids** the following:
<h2>Some string here!</h2>
```

This rule **allows** the following:

``` html
{{! ember-intl example }}
<h2>{{t 'photos.banner' numPhotos=model.photos.length}}</h2>
```

### Configuration

The following values are valid configuration:
Expand Down
Loading

0 comments on commit 9713595

Please sign in to comment.