Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Rule react-a11y-input-elements incorrectly requiring value for file input #841

Closed
HiroshiOHSUGA opened this issue Mar 8, 2019 · 5 comments · Fixed by #858
Closed

Rule react-a11y-input-elements incorrectly requiring value for file input #841

HiroshiOHSUGA opened this issue Mar 8, 2019 · 5 comments · Fixed by #858

Comments

@HiroshiOHSUGA
Copy link

Bug Report

  • tslint-microsoft-contrib version: 6.1.0
  • TSLint version: 5.13.1
  • TypeScript version: 3.3.3333
  • Running TSLint via: CLI

TypeScript code being linted

import * as React from "react";

export const X: React.ReactNode = (
  <input
    type="file"
    accept="image/*"
    placeholder="this is file input"
  />
);

with tslint.json configuration:

defaultSeverity: error
extends:
  - tslint-microsoft-contrib
  - tslint-config-prettier
jsRules:
rules:

Actual behavior

ERROR: (react-a11y-input-elements) /....../X.tsx[4, 5]: Input elements must include default, place-holding characters if empty

Expected behavior

no error

or

What value should I set to value attribute ?

@JoshuaKGoldberg
Copy link

Perhaps @jcnsilva or @lizzzp1 might have input? 😊

@JoshuaKGoldberg JoshuaKGoldberg added the Status: Needs Investigation We're not sure whether this a good thing to do. label Mar 10, 2019
@lizzzp1
Copy link
Contributor

lizzzp1 commented Mar 11, 2019

#754 (comment)
Seems like the error isn't specific enough, but should probably not require a value from certain inputs.

@JoshuaKGoldberg
Copy link

JoshuaKGoldberg commented Mar 11, 2019

Oh is this issue a duplicate of #749 then?

@HiroshiOHSUGA could you try with v6.1.0 of the tslint-microsoft-contrib package? Just noticed the OP version text. Sorry 😄

@IllusionMH
Copy link
Contributor

Actually looks like problem in logic: as I understand #749 and #754 - this test case shouldn't contain erros: ReactA11yInputElementsRuleTests.ts#L34-L62 after fix applied

@HiroshiOHSUGA
Copy link
Author

Any updates on this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants