Standard: Unused variables don't output warnings

Created on 12 Nov 2018  路  3Comments  路  Source: standard/standard

Problem:

The following small React component link.js has a useless destructured variable, it is not being caught by Standard.

import React from 'react'

const Link = ({ url, useless, children }) => (
  <a href={url}>{children}</a>
)

export default Link

What version of standard?

Standard: 12.0.1

What operating system, Node.js, and npm version?

OS: macOS 10.14 (18A391)
Node: v10.11.0
NPM: 6.4.1

What did you expect to happen?

To get an error like

link.js:3:22: 'useless' is assigned a value but never used.

What actually happened?

From what I can recall this would previously output an error since this is a conflict with one of the rules of Standard No unused variables.

Output:

empty output

All 3 comments

From the best I can tell StandardJS has always skipped checking for unused arguments.

I have created a pull request that changes the behavior.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jcalfee picture jcalfee  路  3Comments

caesarsol picture caesarsol  路  3Comments

mightyiam picture mightyiam  路  3Comments

Jakobud picture Jakobud  路  3Comments

rbecheras picture rbecheras  路  3Comments