Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up shared HBS lint configuration #91

Merged
merged 3 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
'use strict'

module.exports = {
extends: 'octane'
extends: [
'octane',
'stylistic',
],

rules: {
'attribute-indentation': {
'indentation': 2,
'open-invocation-max-len': 100,
},

'inline-link-to': 'error',

'no-bare-strings': 'error',

'no-class-bindings': 'error',

'no-element-event-actions': 'error',

'no-link-to-tagname': 'error',

'no-model-argument-in-route-templates': 'error',

'no-this-in-template-only-components': 'error',

'no-yield-to-default': 'error',

'require-form-method': 'warn',
},

overrides: [
{
files: [
'**/tests/dummy/**/*.hbs',
'**/tests/**/*.{js,ts}',
],
rules: {
'no-bare-strings': 'off',
},
},
{
files: [
'**/tests/dummy/app/templates/**/*.hbs',
],

rules: {
'no-this-in-template-only-components': 'off',
},
},
],
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019
Copyright (c) 2021

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:

Expand Down
Empty file added addon/.gitkeep
Empty file.
Empty file added app/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const getChannelURL = require('ember-source-channel-url')
const isCI = !!process.env.CI
const isCI = Boolean(process.env.CI)

module.exports = async function() {
return {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"ember-resolver": "^8.0.0",
"ember-source": "~3.25.3",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.21.0",
"ember-template-lint": "^3.1.1",
"ember-try": "^1.4.0",
"eslint": "^7.5.0",
"eslint-plugin-ember": "^10.1.1",
Expand Down
2 changes: 2 additions & 0 deletions testem.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const lint = process.env.CI ? 'nolint' : ''
const testParams = ['hidepassed', lint].filter(Boolean).join('&')

Expand Down
6 changes: 3 additions & 3 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import loadInitializers from 'ember-load-initializers'
import config from 'dummy/config/environment'

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
modulePrefix = config.modulePrefix
podModulePrefix = config.podModulePrefix
Resolver = Resolver
}

loadInitializers(App, config.modulePrefix)
3 changes: 0 additions & 3 deletions tests/dummy/app/resolver.js

This file was deleted.

4 changes: 2 additions & 2 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import EmberRouter from '@ember/routing/router'
import config from 'dummy/config/environment'

export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
location = config.locationType
rootURL = config.rootURL
}

Router.map(function() {
Expand Down
4 changes: 2 additions & 2 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Application from '../app'
import config from '../config/environment'
import Application from 'dummy/app'
import config from 'dummy/config/environment'
import { setApplication } from '@ember/test-helpers'
import { start } from 'ember-qunit'

Expand Down
Empty file added tests/unit/.gitkeep
Empty file.
76 changes: 65 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,16 @@
resolved "https://registry.yarnpkg.com/@ember-data/rfc395-data/-/rfc395-data-0.0.4.tgz#ecb86efdf5d7733a76ff14ea651a1b0ed1f8a843"
integrity sha512-tGRdvgC9/QMQSuSuJV45xoyhI0Pzjm7A9o/MVVA3HakXIImJbbzx/k/6dO9CUEQXIyS2y0fW6C1XaYOG7rY0FQ==

"@ember-template-lint/todo-utils@^8.0.0-beta.3":
version "8.0.0"
resolved "https://registry.yarnpkg.com/@ember-template-lint/todo-utils/-/todo-utils-8.0.0.tgz#db18b2bbc26fb372062d827138b7e1bb659a30ae"
integrity sha512-bqULTNLWr93SRfM+MkPFN4qdYvdzmvwiPBaHpxQM67qnZ1BCs4Mr7zV8GF8OSmSKbyPNMAN2ZyxsPbNRbN6o3g==
dependencies:
"@types/eslint" "^7.2.7"
fs-extra "^9.1.0"
slash "^3.0.0"
tslib "^2.1.0"

"@ember/edition-utils@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@ember/edition-utils/-/edition-utils-1.2.0.tgz#a039f542dc14c8e8299c81cd5abba95e2459cfa6"
Expand Down Expand Up @@ -1485,6 +1495,19 @@
dependencies:
"@types/node" "*"

"@types/eslint@^7.2.7":
version "7.2.7"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.7.tgz#f7ef1cf0dceab0ae6f9a976a0a9af14ab1baca26"
integrity sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q==
dependencies:
"@types/estree" "*"
"@types/json-schema" "*"

"@types/estree@*":
version "0.0.46"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe"
integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==

"@types/express-serve-static-core@*":
version "4.17.13"
resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.13.tgz#d9af025e925fc8b089be37423b8d1eac781be084"
Expand Down Expand Up @@ -1526,6 +1549,11 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/json-schema@*":
version "7.0.7"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==

"@types/json-schema@^7.0.5":
version "7.0.6"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
Expand Down Expand Up @@ -5170,11 +5198,12 @@ ember-source@~3.25.3:
semver "^6.1.1"
silent-error "^1.1.1"

ember-template-lint@^2.21.0:
version "2.21.0"
resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-2.21.0.tgz#7e120abf309a8810eeed26c52377943faf15a95b"
integrity sha512-19QbEqJQdMfcRS7PsQsubflRowEtnkbD0tpYR4q/xq4lodmhU7hhOFvlTQgbxD/jwW5Ur+tkOwH4KFy9JwOyXA==
ember-template-lint@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/ember-template-lint/-/ember-template-lint-3.1.1.tgz#56f7f4be11241e88a96d436893387229e105fb0d"
integrity sha512-4xtcPPuqGteHhM/5qgy4pHT5bobmcltFyAVIsbdOsqtRJ048KZNd6lLhT521fxmTCbAHkqUGNdPmzCk4VfH5Xg==
dependencies:
"@ember-template-lint/todo-utils" "^8.0.0-beta.3"
chalk "^4.0.0"
ember-template-recast "^5.0.1"
find-up "^5.0.0"
Expand Down Expand Up @@ -6206,6 +6235,16 @@ fs-extra@^9.0.0:
jsonfile "^6.0.1"
universalify "^1.0.0"

fs-extra@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-merger@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/fs-merger/-/fs-merger-3.1.0.tgz#f30f74f6c70b2ff7333ec074f3d2f22298152f3b"
Expand Down Expand Up @@ -10801,6 +10840,11 @@ tslib@^1.10.0, tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==

[email protected]:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
Expand Down Expand Up @@ -10961,6 +11005,11 @@ universalify@^1.0.0:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==

universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==

unorm@^1.5.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af"
Expand Down Expand Up @@ -11079,11 +11128,16 @@ uuid@^8.1.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31"
integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==

v8-compile-cache@^2.0.3, v8-compile-cache@^2.2.0:
v8-compile-cache@^2.0.3:
version "2.2.0"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132"
integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==

v8-compile-cache@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==

validate-npm-package-license@^3.0.1:
version "3.0.4"
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
Expand Down Expand Up @@ -11356,9 +11410,9 @@ workerpool@^5.0.1:
integrity sha512-Sywova24Ow2NQ24JPB68bI89EdqMDjUXo4OpofK/QMD7C2ZVMloYBgQ5J3PChcBJHj2vspsmGx1/3nBKXtUkXQ==

workerpool@^6.0.3:
version "6.1.0"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b"
integrity sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==
version "6.1.2"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.2.tgz#52bb8c05d89e9b699b68d39f9687419cb2f6ca5c"
integrity sha512-I/gDW4LwV3bslk4Yiqd4XoNYlnvV03LON7KuIjmQ90yDnKND1sR2LK/JA1g1tmd71oe6KPSvN0JpBzXIH6xAgA==

wrap-ansi@^7.0.0:
version "7.0.0"
Expand Down Expand Up @@ -11463,9 +11517,9 @@ yam@^1.0.0:
lodash.merge "^4.6.0"

yargs-parser@^20.2.2:
version "20.2.6"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.6.tgz#69f920addf61aafc0b8b89002f5d66e28f2d8b20"
integrity sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==
version "20.2.7"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==

yargs@^16.2.0:
version "16.2.0"
Expand Down