Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #2647
Closed
Open
Issue created Jun 27, 2017 by Administrator@rootContributor

ESLint - no-unused-expressions warning for template tags

Created by: ffxsam

I'm using styled-components' injectGlobal template tag function, like so:

injectGlobal`
  .ant-btn-clicked:after {
    border: 0 solid ${mainTheme.primaryColor.toString()} !important;
  }

  .ant-switch-checked {
    background-color: ${mainTheme.primaryColor.toString()} !important;
    border-color: ${mainTheme.primaryColor.toString()} !important;
  }
`;

And I got warnings about injectGlobal being an unused expression. So I've modified my .eslintrc to be the following:

{
  "extends": "react-app",
  "rules": {
    "no-unused-expressions": ["error", {"allowTaggedTemplates": true}]
  }
}

This seems to stop ESLint warnings in Nuclide, but I'm still getting them in the browser console and shell:

./src/themes.js
  Line 20:  Expected an assignment or function call and instead saw an expression  no-unused-expressions

Am I configuring something wrong?

Assignee
Assign to
Time tracking