I'm trying to leverage yaml anchors for common settings in between ts and js lint rules, and encounter following error:
zzzz[~/../../../zzzz/client/ (develop *% u=)]$ yarn lint_tsjs
yarn run v1.5.1
$ tslint -c tslint.yml "!(node_modules)/**/*.js?(x)"
Could not find implementations for the following rules specified in the configuration:
<<
Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.
I tested [email protected] and it will expand tslint.yaml into json as expected with default settings.
with tslint.yaml configuration:
defaultSeverity: error
linterOptions:
exclude:
- "coverage/**/*"
- "dist/**/*"
- "config/utils/**/*.js"
- "src/common/components/forms/**/*.js"
- "**/mockData.js"
- "**/reactCountDownTimer/**/*.js"
extends:
- tslint:recommended
- tslint-react
rules: &TS_RULES
semicolon:
- true
- never
quotemark:
- true
- single
- jsx-double
indent:
- true
- spaces
- 2
ordered-imports: false
interface-name: false
member-access: false
object-literal-sort-keys: false
trailing-comma: false
space-before-function-paren: true
arrow-parens: false
jsx-no-lambda: true
jsRules:
# common rules with ts
<<: *TS_RULES
# semicolon:
# - true
# - never
# quotemark:
# - true
# - single
# - jsx-double
# indent:
# - true
# - spaces
# - 2
# ordered-imports: false
# interface-name: false
# member-access: false
# object-literal-sort-keys: false
# trailing-comma: false
# space-before-function-paren: true
# arrow-parens: false
# jsx-no-lambda: true
# specific rules for js
jsdoc-format: false
curly:
- true
- ignore-same-line
max-line-length:
- true
- 180
rulesDirectory: []
zzzz[~/../../../zzzz/client/ (develop *% u=)]$ yarn lint_tsjs
yarn run v1.5.1
$ tslint -c tslint.yml "!(node_modules)/**/*.js?(x)"
Could not find implementations for the following rules specified in the configuration:
<<
Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.
anchor expended to the actual rules
Thank you
@dmi3y would #1071: Cosmiconfig support fix this?
As far as I can tell, there shouldn't be any harm in using the default schema for js-yaml, it just adds support for some extra YAML types. Here is a codepen showcasing everything it adds over the JSON schema: https://codepen.io/anon/pen/rQXdbm?editors=0012
I just made a pull request which makes the change. I've been using it locally and haven't had any issues.
Also, in regards to @JoshuaKGoldberg's question about Cosmiconfig above, it should also fix this, as Cosmiconfig uses js-yaml's default schema, so it would support this.
Great! Thanks guys.
Fixed by #4350 ✨
Most helpful comment
As far as I can tell, there shouldn't be any harm in using the default schema for js-yaml, it just adds support for some extra YAML types. Here is a codepen showcasing everything it adds over the JSON schema: https://codepen.io/anon/pen/rQXdbm?editors=0012
I just made a pull request which makes the change. I've been using it locally and haven't had any issues.
Also, in regards to @JoshuaKGoldberg's question about Cosmiconfig above, it should also fix this, as Cosmiconfig uses js-yaml's default schema, so it would support this.