Skip to content

Prettier/ESLint Configuration Updates - #7

Merged
daveseah merged 5 commits into
devfrom
dev-ds/eslint-config
Jun 27, 2023
Merged

Prettier/ESLint Configuration Updates#7
daveseah merged 5 commits into
devfrom
dev-ds/eslint-config

Conversation

@daveseah

@daveseah daveseah commented Jun 27, 2023

Copy link
Copy Markdown
Collaborator

I've updated ESLint and Prettier packages. The old .eslintrc.json file has been replaced with .eslintrc.js which imports a separate .eslint-rules.js file that has our specific overrides.

CHANGES

  • The new ESLint configuration is based on the GEMSTEP configuration with all the Typescript stuff stripped out. In extends, we start with the recommended ESLint and React rules, and override any formatting-related rules with the Prettier overrides. The rules are then overriding additional rules that we find annoying via .eslintrc-rules.js.
  • Workspace settings updated to include module snippets, recommended extensions, and configure use of Prettier formatter.
  • .prettierignore has been removed

HOW TO FIX YOUR CODE

As you find problem files, open the PROBLEMS tab in the terminal window and see what pops up!

image

SRI-STYLE SECTION COMMENTS

There are "regex highlighting" expressions added to the .code-workspace project file that will draw comment lines beginning with /// as blue. These are used to make it easier to find code sections.

image

To quickly get a scaffolded Sri-style module, use the command Snippets: Insert Snippet and choose urp-module-elements to get this:

image

dsriseah added 5 commits June 27, 2023 13:07
.vscode folder contains module snippets, settings to enforce recommended extensions and to force use of prettier as default formatter. It tells eslint to validate both javascript and typescript files. The workspace file also cleaned up
A comment line starting with /// is used to denote sections in a Sri-style module. A VSCode "Highlight Regex" is used to draw these distinctly so it's easier to see the sections.
@daveseah
daveseah merged commit 1cd5270 into dev Jun 27, 2023
@daveseah
daveseah deleted the dev-ds/eslint-config branch July 14, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants