Skip to content

Disable role linting in Routes#2318

Merged
dac09 merged 3 commits intomainfrom
ds-disable-role-linting-in-routes
Apr 20, 2021
Merged

Disable role linting in Routes#2318
dac09 merged 3 commits intomainfrom
ds-disable-role-linting-in-routes

Conversation

@jtoar
Copy link
Copy Markdown
Contributor

@jtoar jtoar commented Apr 18, 2021

Closes #2303. We were incorrectly linting the role attribute of the Private component in Routes. This PR completely disables the rule in just the Routes file. Tape showing it doesn't throw an error now: https://s.tape.sh/9hEMulMa

Here's the rule we're disabling for reference: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md.

One question: if we allow arbitrary code in the Routes file, do we want to reenable this rule but only disable it for Private components? Basically, how likely is it we see a11y errors in Routes? Seems pretty unlikely, but thoughts?

Update: changed it to ignoreNonDom so we still get linting on regular markup.

@jtoar jtoar added topic/config Babel, Webpack, ESLint, Prettier, etc. topic/a11y labels Apr 18, 2021
@jtoar jtoar self-assigned this Apr 18, 2021
@jtoar jtoar requested a review from dthyresson April 18, 2021 17:51
@jtoar jtoar requested a review from peterp April 18, 2021 17:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 18, 2021

📦 PR Packages

Click to Show Package Download Links

https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/create-redwood-app-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-api-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-api-server-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-auth-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-cli-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-core-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-dev-server-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-eslint-config-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-eslint-plugin-redwood-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-forms-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-internal-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-prerender-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-router-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-structure-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-testing-0.30.1-603a64e.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/2318/redwoodjs-web-0.30.1-603a64e.tgz

Install this PR by running yarn rw upgrade --pr 2318:0.30.1-603a64e

@cypress
Copy link
Copy Markdown

cypress Bot commented Apr 18, 2021



Test summary

11 0 1 0Flakiness 0


Run details

Project RedwoodJS Framework
Status Passed
Commit 566701e ℹ️
Started Apr 20, 2021 9:10 AM
Ended Apr 20, 2021 9:13 AM
Duration 02:37 💡
OS Linux Ubuntu - 20.04
Browser Chrome 89

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Comment thread packages/eslint-config/index.js Outdated
@dac09
Copy link
Copy Markdown
Contributor

dac09 commented Apr 20, 2021

Haha "ignoreNonDom". Don't ignore Dominic!

@dac09 dac09 merged commit 293c99d into main Apr 20, 2021
@dac09 dac09 deleted the ds-disable-role-linting-in-routes branch April 20, 2021 09:29
@thedavidprice thedavidprice modified the milestones: patch, next-release Apr 21, 2021
dac09 added a commit to dac09/redwood that referenced this pull request Apr 21, 2021
…erve-web

* 'main' of github.com:redwoodjs/redwood: (40 commits)
  Support generating typescript cells and pages | Autodetect ts project (redwoodjs#2279)
  create-redwood-app messages: moved app start commands to end (redwoodjs#2278)
  Add import type to configuration files (redwoodjs#2214)
  Bump @reach/skip-nav from 0.13.2 to 0.15.0 (redwoodjs#2237)
  Adding Setup Deploy Render Command (redwoodjs#2099)
  Disable role linting in Routes (redwoodjs#2318)
  v0.30.1 (redwoodjs#2322)
  teardown should attempt to delete dbName table (redwoodjs#2083)
  Restore @storybook/addon-a11y (redwoodjs#2309)
  fix(auth): Implement automatic token refresh on supported providers (redwoodjs#2277)
  fix(cli): move api-server dep from api to cli (redwoodjs#2307)
  Static typing for cells (redwoodjs#2208)
  Recommended Babel package upgrades (dependabot) (redwoodjs#2255)
  v0.30.0 (redwoodjs#2301)
  upgrade Prisma v2.21.0 (redwoodjs#2273)
  Further improvements to CONTRIBUTING.md (redwoodjs#2261)
  Adds better messages for rwt link | Watcher does not exist on build failure | Only remove node_modules after a succesful framework build (redwoodjs#2269)
  Update named param types in router readme (redwoodjs#2262)
  Bump core-js from 3.6.5 to 3.10.1 (redwoodjs#2243)
  Fix: webpack optimizations for JS (redwoodjs#2235)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic/a11y topic/config Babel, Webpack, ESLint, Prettier, etc. topic/router-&-navigation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility: Lint warning with roles in Private route

5 participants