Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [comma-spacing] allow no space after trailing comma in objects and arrays #6938

Conversation

islandryu
Copy link
Contributor

@islandryu islandryu commented Apr 20, 2023

PR Checklist

Overview

The following cases are allowed to pass

const arr = [a ,];
const obj = {'foo':'bar', 'baz':'qur',};

The following test case passed in eslint, but I wasn't sure if it should be compliant, so I put it on hold
eslint/eslint#16113

    { code: 'const arr = [1 , ];', options: [{ before: true, after: false }] },
    { code: 'const arr = [,2 , ];', options: [{ before: true, after: false }] },
    {
      code: "const obj = {'foo':'bar' ,'baz':'qur' , };",
      options: [{ before: true, after: false }],
    },

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @islandryu!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Apr 20, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 9e4e9aa
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6440a357a22a120008b4b0f5
😎 Deploy Preview https://deploy-preview-6938--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@islandryu islandryu changed the title feat(eslint-plugin):[comma-spacing]allow no space after trailing comma in objects and arrays fix(eslint-plugin): [comma-spacing]allow no space after trailing comma in objects and arrays Apr 20, 2023
@islandryu islandryu changed the title fix(eslint-plugin): [comma-spacing]allow no space after trailing comma in objects and arrays fix(eslint-plugin): [comma-spacing] allow no space after trailing comma in objects and arrays Apr 20, 2023
@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Merging #6938 (9e4e9aa) into main (4f3750f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6938   +/-   ##
=======================================
  Coverage   87.37%   87.37%           
=======================================
  Files         386      386           
  Lines       13192    13197    +5     
  Branches     3867     3869    +2     
=======================================
+ Hits        11526    11531    +5     
  Misses       1300     1300           
  Partials      366      366           
Flag Coverage Δ
unittest 87.37% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/eslint-plugin/src/rules/comma-spacing.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@islandryu islandryu marked this pull request as ready for review April 20, 2023 03:43
@bradzacher bradzacher added the bug Something isn't working label Apr 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg added the formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. label Apr 24, 2023
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm liking this nice clean implementation... very well done @islandryu!

Sorry for the delay here - we've been pretty focused on v6. But I'm glad to see this PR! ❤️

@JoshuaKGoldberg JoshuaKGoldberg merged commit 24bdacc into typescript-eslint:main Jul 8, 2023
44 of 46 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [comma-spacing] conflicts with array-bracket-spacing
3 participants