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

Chore: enable quote avoidEscape option in eslint-config-eslint #10626

Merged
merged 1 commit into from Sep 2, 2018

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Jul 19, 2018

it can be more readable to use:

var s = `"hello world!"`;

than

var s = "\"hello world!\"";

hopefully, the option can be enabled by default?

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jul 19, 2018
@aladdin-add aladdin-add added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion chore This change is not user-facing and removed triage An ESLint team member will look at this issue soon labels Jul 19, 2018
@aladdin-add aladdin-add changed the title Chore: quote enable avoidEscape option in eslint-config-eslint Chore: enable quote avoidEscape option in eslint-config-eslint Jul 19, 2018
@aladdin-add
Copy link
Member Author

still not working, but that seems a bug to me. (#10627)

@platinumazure
Copy link
Member

Hi @aladdin-add, thanks for the PR.

Just out of curiosity, what problem are you trying to solve here? Is the current configuration actually causing a lot of problems (i.e., are there many strings in ESLint or another repository which suffer from lots of escape sequences)?

@aladdin-add
Copy link
Member Author

aladdin-add commented Jul 26, 2018

the problem is the current config disallows a better code(at least in my view).

a common usage is code tests:

valid: [
  "var s = \"hello\";",
]

@aladdin-add
Copy link
Member Author

aladdin-add commented Aug 20, 2018

I'm seeing a large number of cases using escape, seems enabling the option could be easier to write and read. thoughts?
/cc @platinumazure @eslint/eslint-team

e.g.

"import os from \"os\";\nimport fs from \"fs\";",
"import { merge } from \"lodash-es\";",
"import _, { merge } from \"lodash-es\";",
"import * as Foobar from \"async\";",
"import \"foo\"",
"import os from \"os\";\nexport { something } from \"os\";",
{
code: "import os from \"os\";\nexport { hello } from \"hello\";",
options: [{ includeExports: true }]
},
{
code: "import os from \"os\";\nexport * from \"hello\";",
options: [{ includeExports: true }]
},
{
code: "import os from \"os\";\nexport { hello as hi } from \"hello\";",
options: [{ includeExports: true }]
},
{
code: "import os from \"os\";\nexport default function(){};",
options: [{ includeExports: true }]
},
{
code: "import { merge } from \"lodash-es\";\nexport { merge as lodashMerge }",
options: [{ includeExports: true }]

@platinumazure
Copy link
Member

Thanks @aladdin-add. I'm 👍 to this change if it makes our rule tests easier to read.

@platinumazure
Copy link
Member

@eslint/eslint-team Any thoughts on this? Seems reasonable to make some of our tests easier to write (IMO).

@platinumazure platinumazure removed the request for review from kaicataldo September 1, 2018 02:36
@aladdin-add
Copy link
Member Author

thanks for the feedback, seems we have more than 4 👍 from the team members. labelled accepted.

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 1, 2018
@aladdin-add aladdin-add merged commit 0a65844 into master Sep 2, 2018
@aladdin-add aladdin-add deleted the chore/eslint-config branch September 2, 2018 18:25
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 3, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants