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

refactor: Lint for no interpolation in regular string #5060

Merged
merged 4 commits into from
Dec 29, 2022

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Dec 29, 2022

Request: #5057 (review)

Again, wrote tests but RuleTester is unable to parse backticks:

ruleTester.run('no-interpolation-in-regular-string', rules['no-interpolation-in-regular-string'], {
	valid: [
		{
			code: "var str = 'This is a test';",
		},
		{
			code: 'var str = "This is a test";',
		},
		{
			code: 'var str = `This is a ${test}`;',
		},
	],
	invalid: [
		{
			code: "var str = 'This is a ${test}'",
			errors: [{ messageId: 'useBackticks' }],
			output: 'var str = `This is a ${test}`',
		},
	],
});

@@ -6,6 +6,7 @@ import { completeFromList, snippetCompletion } from '@codemirror/autocomplete';
*/
export const jsSnippets = completeFromList([
...snippets.filter((snippet) => snippet.label !== 'class'),
// eslint-disable-next-line n8n-local-rules/no-interpolation-in-regular-string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Dec 29, 2022
Copy link
Member

@netroy netroy left a comment

Choose a reason for hiding this comment

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

Works as expected 👏🏽

image

@netroy netroy merged commit 0b47f9c into master Dec 29, 2022
@netroy netroy deleted the lint-for-no-interpolation-in-regular-string branch December 29, 2022 13:24
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Dec 29, 2022
MiloradFilipovic added a commit that referenced this pull request Dec 29, 2022
* master:
  ci: Fix linting on builds (no-changelog) (#5062)
  refactor: Lint for no interpolation in regular string (#5060) (no-changelog)
  ci: Fix lint for build (no-changelog) (#5059)
  perf: Prevent oclif from loading ts-node and typescript (#5047) (no-changelog)
  fix(editor): Make node title non-editable in executions view (#5046)
  refactor: Lint for no unneeded backticks (#5057) (no-changelog)
  fix(core): Fix full manual execution for error trigger as starter of 2+ node workflow (#5055)
  fix(editor): Support tabbing away from inline expression editor (#5056)
  refactor(editor): Usage and plans page on Desktop (#5051)
  📚 Update CHANGELOG.md and main package.json to 0.209.4
  🔖 Release [email protected]
  ⬆️ Set [email protected] on n8n
  🔖 Release [email protected]
  fix(editor): Usage and plans page on Desktop (#5045)
  feat(editor): Switch to expression on `=` input (#5044)
  fix(editor): Fix trigger node type identification on add to canvas (#5043)
@janober
Copy link
Member

janober commented Jan 5, 2023

Got released with [email protected]

@janober janober removed the Upcoming Release Will be part of the upcoming release label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants