Skip to content

Commit

Permalink
npm v7 & dependency improvements (#234)
Browse files Browse the repository at this point in the history
The npm CLI v7 [1] introduced the new `package-lock.json` format v2 [2]
that unlocks the ability to do deterministically reproducible builds and
includes everything npm needs to fully build the package tree.
Since this is a new major version the current `package-lock.json` file
has been updated to the new format.

At the same time outdated dependencies have been upgraded to their
latest, compatible version. This also changes the versions to use the
`^` caret range selector [7] to reduce the overhead of updating
dependencies.

- `@arcticicestudio/eslint-config-base` [5] - the minimum versions
  have been bumped from `0.5.0` to `0.11.0` [6].
- `babel-eslint` [3] -> [`@babel/eslint-parser`][4] - the `babel-eslint`
  package is deprecated and is now available as `@babel/eslint-parser`.
- `eslint-plugin-json` [8] -> [`eslint-plugin-jsonc`][9] - since
  Visual Studio Code uses JSONC [10] the `eslint-plugin-jsonc` matches
  better to the scope of this repository. It also utilizies the ESLint
  engine by passing the AST to it.
- `del-cli` [13] - updated from version `1.1.0` [11] to `^4.0.1` [12].
- `eslint` [14] - updated from version `5.16.0` [15] to `^7.32.0` [16].
- `eslint-plugin-import` [17] - updated from version `2.17.3` [18] to
  `^2.24.2` [19].
- `eslint-plugin-prettier` [20] - updated from version `3.1.0` [18] to
  `^4.0.0` [22].
- `prettier` [23] - updated from version `1.17.1` [24] to `^2.4.1` [25].
- `remark-cli` [26] - updated from version `6.0.1` [27] to
  `^9.0.0` [28].
- `remark-preset-lint-arcticicestudio` [29] ->
  `@arcticicestudio/remark-preset-lint` [30] - the
  `remark-preset-lint-arcticicestudio` package is deprecated and is now
  available as `@arcticicestudio/remark-preset-lint`. This also includes
  the linting and adjusting for matches that are found after running
  with the new rules.
- `vsce` [31] - updated from version `6.0.1` [32] to `^1.100.0` [33].

[1]: https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli
[2]: https://blog.npmjs.org/post/621733939456933888/npm-v7-series-why-keep-package-lockjson
[3]: https://github.com/babel/babel-eslint
[4]: https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser
[5]: https://github.com/arcticicestudio/styleguide-javascript/tree/main/packages/%40arcticicestudio/eslint-config-base
[6]: https://github.com/arcticicestudio/styleguide-javascript/releases/tag/v0.11.0
[7]: https://semver.npmjs.com
[8]: https://github.com/azeemba/eslint-plugin-json
[9]: https://github.com/ota-meshi/eslint-plugin-jsonc
[10]: https://komkom.github.io
[11]: https://github.com/sindresorhus/del-cli/releases/tag/v1.1.0
[12]: https://github.com/sindresorhus/del-cli/releases/tag/v4.0.1
[13]: https://github.com/sindresorhus/del-cli
[14]: https://eslint.org
[15]: https://github.com/eslint/eslint/releases/tag/v5.16.0
[16]: https://github.com/eslint/eslint/releases/tag/v7.32.0
[17]: https://github.com/import-js/eslint-plugin-import
[18]: https://github.com/import-js/eslint-plugin-import/releases/tag/v2.17.3
[19]: https://github.com/import-js/eslint-plugin-import/releases/tag/v2.24.2
[20]: https://github.com/prettier/eslint-plugin-prettier
[21]: https://github.com/prettier/eslint-plugin-prettier/releases/tag/v3.1.0
[22]: https://github.com/prettier/eslint-plugin-prettier/releases/tag/v4.0.0
[23]: https://prettier.io
[24]: https://github.com/prettier/prettier/releases/tag/2.4.1
[25]: https://github.com/prettier/prettier/releases/tag/2.4.1
[26]: https://remark.js.org
[27]: https://github.com/remarkjs/remark/releases/tag/remark-cli%406.0.1
[28]: https://github.com/remarkjs/remark/releases/tag/remark-cli%409.0.0
[29]: https://www.npmjs.com/package/remark-preset-lint-arcticicestudio
[30]: https://github.com/arcticicestudio/styleguide-markdown/tree/main/packages/%40arcticicestudio/remark-preset-lint
[31]: https://github.com/microsoft/vscode-vsce
[32]: https://github.com/microsoft/vscode-vsce/releases/tag/v1.62.0
[33]: https://github.com/microsoft/vscode-vsce/releases/tag/v1.100.0


Co-authrored-by: Sven Greb <development@svengreb.de>

Closes GH-233
  • Loading branch information
arcticicestudio committed Sep 25, 2021
1 parent 2ea762e commit e188f06
Show file tree
Hide file tree
Showing 17 changed files with 10,161 additions and 4,239 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# +--------------------+
# + Base Configuration +
# +--------------------+
root = true

[*]
charset = utf-8
end_of_line = lf
Expand All @@ -22,4 +24,5 @@ trim_trailing_whitespace = true
# +-----------+
# +--- Markdown ---+
[*.{md}]
max_line_length = off
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.github/*
.vscode/*
assets/*
**/node_modules/*
node_modules/*
*.vsix
!lint-staged.config.js
!.eslintrc.js
Expand Down
32 changes: 14 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@
*/

/**
* @file The ESLint configuration.
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* @see https://github.com/babel/eslint-plugin-babel#rules
* @see https://github.com/tc39/proposal-optional-chaining
* @see https://eslint.org/docs/user-guide/configuring#specifying-environments
* Configurations for ESLint.
*
* @see https://eslint.org/docs/user-guide/configuring
*/

module.exports = {
extends: "arcticicestudio-base",
plugins: ["json", "prettier"],
parser: "babel-eslint",
env: {
node: true,
browser: true
},
rules: {
/* Prioritize format errors found by Prettier. */
"prettier/prettier": "error"
}
extends: [
"plugin:jsonc/recommended-with-jsonc",
"@arcticicestudio/eslint-config-base",
/*
* Enable support for projects using Prettier.
* Note that this must always be placed after the `@arcticicestudio/eslint-config-base` preset to take precedence,
* otherwise it won't prevent errors due to useless and possibly conflicting rules!
*/
"@arcticicestudio/eslint-config-base/prettier",
],
plugins: ["jsonc"],
};
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# Automatically perform line feed (LF) normalization for files detected as text and leave all files detected as binary
# untouched.
* text=auto
* text=auto eol=lf

# +--------+
# + Assets +
Expand Down
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,10 @@
# Repository: https://github.com/arcticicestudio/nord-visual-studio-code
# License: MIT

# +------+
# + Logs +
# +------+
logs/
**/*.log
npm-debug.log*

# +---------+
# + Node.js +
# +---------+
**/node_modules/
.npm/

# +--------------------+
# + Visual Studio Code +
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
18 changes: 18 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Copyright (C) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
# Copyright (C) 2017-present Sven Greb <development@svengreb.de>
#
# Project: Nord Visual Studio Code
# Repository: https://github.com/arcticicestudio/nord-visual-studio-code
# License: MIT

# Git "pre-commit" hook for husky.
#
# References:
# 1. https://github.com/typicode/husky
# 2. https://git-scm.com/docs/githooks#_pre_commit

. "$(dirname "$0")/_/husky.sh"

npm exec lint-staged
21 changes: 0 additions & 21 deletions .huskyrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# License: MIT

package-lock=true
save-exact=true
save-exact=false
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
# License: MIT

assets/*
**/node_modules/*
package-lock.json
node_modules/*
*.vsix
9 changes: 4 additions & 5 deletions .remarkrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
*/

/**
* @file The remark-lint configuration.
* @author Arctic Ice Studio <development@arcticicestudio.com>
* @author Sven Greb <development@svengreb.de>
* Configurations for remark-lint.
*
* @see https://github.com/remarkjs/remark-lint
*/

module.exports = {
plugins: ["remark-preset-lint-arcticicestudio"]
plugins: ["@arcticicestudio/remark-preset-lint"],
};
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ All currently implemented Gulp tasks have therefore been migrated to npm scripts
<p align="center"><img src="https://camo.githubusercontent.com/0839818322a1f81721f7f35e55e5a84fc8f27437/68747470733a2f2f70726574746965722e696f2f69636f6e2e706e67" width="200" /></p>

**Arctic Ice Studio ESLint rule set**#75#87 (⊶ c9e0c93d)
↠ The default rule set coming with [ESLint][] has been replaced with [Arctic Ice Studio's custom rule set][eslint-config-arcticicestudio-base] that adheres to the [Arctic Ice Studio JavaScript code style][gh-arcticicestudio/styleguide-javascript].
↠ The default rule set coming with [ESLint][] has been replaced with [Arctic Ice Studio's custom rule set][npm-eslint-config-arcticicestudio-base] that adheres to the [Arctic Ice Studio JavaScript code style][gh-arcticicestudio/styleguide-javascript].

<p align="center"><img src="https://cdn-images-1.medium.com/max/1920/1*_jMm9Z6Adgj6BIso7kCEhA.png" width="888" /></p>

Expand Down Expand Up @@ -1258,7 +1258,6 @@ Detailed information about features, supported languages and install instruction
[ci-circle-docs-api-2.0]: https://circleci.com/docs/2.0
[ci-circle]: https://circleci.com
[ci-travis]: https://travis-ci.org
[eslint-config-arcticicestudio-base]: https://www.npmjs.com/package/eslint-config-arcticicestudio-base
[eslint]: https://eslint.org
[gh-118]: https://github.com/arcticicestudio/nord-visual-studio-code/issues/118
[gh-arcticicestudio/styleguide-git]: https://github.com/arcticicestudio/styleguide-git
Expand Down Expand Up @@ -1286,6 +1285,7 @@ Detailed information about features, supported languages and install instruction
[gulp]: https://gulpjs.com
[nord]: https://www.nordtheme.com
[nord#55]: https://github.com/arcticicestudio/nord/issues/55
[npm-eslint-config-arcticicestudio-base]: https://www.npmjs.com/package/eslint-config-arcticicestudio-base
[npm-remark-preset-lint-arcticicestudio]: https://www.npmjs.com/package/remark-preset-lint-arcticicestudio
[ossg-contrib]: https://opensource.guide/how-to-contribute
[ossg]: https://opensource.guide
Expand Down Expand Up @@ -1385,7 +1385,7 @@ Detailed information about features, supported languages and install instruction

[gh-user-kufii]: https://github.com/kufii
[mdn-js-templ_lit]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
[vsc-rln-1.40]: https://code.visualstudio.com/updates/v1_22
[vsc-rln-1.40]: https://code.visualstudio.com/updates/v1_40
[vsc-rln-1.40#ac_bar_ind]: https://code.visualstudio.com/updates/v1_40#_activity-bar-indicator
[vsc-rln-1.41#mm_warn_err]: https://code.visualstudio.com/updates/v1_41#_minimap-decorations-for-errors-warnings-and-content-changes
[vsc-rln-1.43#mm_bg_slider]: https://code.visualstudio.com/updates/v1_43#_minimap-background-and-slider-colors
Expand All @@ -1397,7 +1397,6 @@ Detailed information about features, supported languages and install instruction

[gh-compare-tag-v0.15.0_v0.15.1]: https://github.com/arcticicestudio/nord-visual-studio-code/compare/v0.15.0...v0.15.1
[npm-@arcticicestudio/eslint-config-base]: https://www.npmjs.com/package/@arcticicestudio/eslint-config-base
[npm-eslint-config-arcticicestudio-base]: https://www.npmjs.com/package/eslint-config-arcticicestudio-base

<!-- v0.16.0 -->

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ You can help improve the docs and guides by making them more coherent, consisten

## Branch Organization

Nord Visual Studio Code uses the [gitflow][gitflow] branching model. The repository consists of two core branches with an infinite development lifecycle:
Nord Visual Studio Code uses the [gitflow][] branching model. The repository consists of two core branches with an infinite development lifecycle:

- `master` - The source code of `HEAD` always reflects a tagged release version.
- `develop` - The default branch where the source code of `HEAD` always reflects a state with the latest development state.
Expand Down Expand Up @@ -144,7 +144,7 @@ Nord Visual Studio Code adheres to the [Arctic Ice Studio Git Style Guide][gh-st

[![][gh-styleguide-git-badge]][gh-styleguide-git]

The style guide assumes that you are familiar with the [gitflow][gitflow] branching model.
The style guide assumes that you are familiar with the [gitflow][] branching model.

## MCVE

Expand All @@ -156,7 +156,7 @@ When [reporting a bug](#bug-reports), sometimes even when [suggesting enhancemen
- …Complete – Provide all parts needed to reproduce the behavior
- …Verifiable – Test the code you're about to provide to make sure it reproduces the behavior

A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][sscce], a _Short, Self Contained, Correct (Compilable), Example_.
A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][], a _Short, Self Contained, Correct (Compilable), Example_.

The recommended way for GitHub based projects is to create it as [Gist][gh-gist] or new repository, but of course you can [attach it to issues and pull requests as files][ghh-attach-file], use any free code paste- or file hosting service or paste the code in [Markdown code blocks][ghh-markdown-code-blocks] into the issue.

Expand Down
4 changes: 2 additions & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

module.exports = {
"*.{js,json,md,yml}": "prettier --list-different",
"*.{js,json,md,yaml,yml}": "prettier --check",
"*.{js,json}": "eslint --ext .js,.json",
"*.md": "remark --no-stdout"
"*.md": "remark --no-stdout",
};

0 comments on commit e188f06

Please sign in to comment.