Skip to content

Commit

Permalink
Migrate to @arcticicestudio/remark-preset-lint (#48)
Browse files Browse the repository at this point in the history
The `remark-preset-lint-arcticicestudio` package has been deprecated
during the migration into a monorepo [1] and replaced by the new
`@arcticicestudio/remark-preset-lint` package [2]. This package also
introduces support for remark `13.0.0` [3] which comes with some new
features and great improvements.

To migrate to the new package the `remark-preset-lint-arcticicestudio`
preset has been replaced by the new
`@arcticicestudio/remark-preset-lint` preset in the `.remarkrc.js` file.

Afterwards all checks have been run to fix and/or improve the findings
with the new preset.

[1]: svengreb/styleguide-markdown#10
[2]: https://github.com/arcticicestudio/styleguide-markdown/tree/main/packages/%40arcticicestudio/remark-preset-lint
[3]: svengreb/styleguide-markdown#28

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

Closes GH-47
  • Loading branch information
arcticicestudio authored Apr 6, 2021
1 parent ab59f71 commit 90953d7
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .remarkrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
module.exports = {
plugins: [
"remark-preset-lint-arcticicestudio",
"@arcticicestudio/remark-preset-lint",
/* Disabled to suppress warnings about duplicate "Example" headings. */
["remark-lint-no-duplicate-headings", false],
],
Expand Down
52 changes: 21 additions & 31 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,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][ghd-attach-file], use any free code paste- or file hosting service or paste the code in [Markdown code blocks][ghd-markdown-code-blocks] into the issue.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The [project documentation][docs] contains chapters to learn about the [comprehe

### ESLint Configurations

To follow these rules in a project use the official extensible code linter configurations [@arcticicestudio/eslint-config-base][gh-t-pkg-esl-conf-base] for [ESLint][eslint]. The advanced [@arcticicestudio/eslint-config][gh-t-pkg-esl-conf] package provides support for specific [React][] and [JSX A11Y][npm-eslint-plugin-jsx-a11y] rules as well as compatibility integrations for other projects like [Prettier][].
To follow these rules in a project use the official extensible code linter configurations [@arcticicestudio/eslint-config-base][gh-t-pkg-esl-conf-base] for [ESLint][]. The advanced [@arcticicestudio/eslint-config][gh-t-pkg-esl-conf] package provides support for specific [React][] and [JSX A11Y][npm-eslint-plugin-jsx-a11y] rules as well as compatibility integrations for other projects like [Prettier][].

To lint projects build with [TypeScript][], the [@arcticicestudio/eslint-config-typescript][gh-t-pkg-esl-ts] package can be extended for full compatibility with the TypeScript compiler in combination with the powerful ESLint engine. It also allows to lint mixed projects consisting of both TypeScript and JavaScript sources.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<p align="center"><a href="https://github.com/arcticicestudio/styleguide-javascript/actions" target="_blank" rel="noreferrer"><img src="https://img.shields.io/github/workflow/status/arcticicestudio/styleguide-javascript/ci?style=flat-square&label=CI&logoColor=eceff4&colorA=4c566a&logo=github-actions"/></a></p>

This package implements the rules of the [Arctic Ice Studio JavaScript style guide][gh-stg-repo] as an extensible shared [ESLint][] configuration with plugin support for [TypeScript][typescript] through the official [TypeScript ESLint][gh-esl-ts] project as well as compatibility integrations for other projects like [Prettier][].
This package implements the rules of the [Arctic Ice Studio JavaScript style guide][gh-stg-repo] as an extensible shared [ESLint][] configuration with plugin support for [TypeScript][] through the official [TypeScript ESLint][gh-esl-ts] project as well as compatibility integrations for other projects like [Prettier][].

## Getting Started

Expand Down
9 changes: 6 additions & 3 deletions packages/@arcticicestudio/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
* @see https://eslint.org/docs/user-guide/configuring.html#configuring-rules
*/
module.exports = {
extends: ["@arcticicestudio/eslint-config-base", "./rules/react", "./rules/react/jsx", "./rules/jsx-a11y"].map(
require.resolve,
),
extends: [
"@arcticicestudio/eslint-config-base",
require.resolve("./rules/react"),
require.resolve("./rules/react/jsx"),
require.resolve("./rules/jsx-a11y"),
],
};
4 changes: 2 additions & 2 deletions src/rules/ecmascript_6+_styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This chapter is a collection of links in this style guide to the various ES6+ fe
- [Object Concise][objects-es6_concise]
- [Computed Object Properties][objects-es6_computed_properties]
- [Template Literals][strings-es6_template_literals]
- [Destructuring][destructuring]
- [Destructuring][]
- [Default Function Parameters][functions-default_parameters]
- [Object Rest Spread][objects-rest_spread]
- [Function Rest Spread][functions-es6_rest]
Expand All @@ -15,7 +15,7 @@ This chapter is a collection of links in this style guide to the various ES6+ fe
- [`let`][references-disallow_var] and [`const`][references-prefer_const]
- [Exponentiation Operator][properties-exponentiation_operator]
- [Iterators and Generators][iterators_and-generators]
- [Modules][modules]
- [Modules][]

## TC39 Proposals

Expand Down
4 changes: 2 additions & 2 deletions src/rules/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Use named function expressions instead of function declarations. Function declarations are hoisted, which means that it is (too) easy to reference the function before it is defined in the file. This harms readability and maintainability.

Functions which definition is too large or complex should be extracted into a own module. Make sure to explicitly name the expression, regardless of whether or not the name is inferred from the containing variable which is often the case in modern browsers or when using compilers such as [Babel][babel]. This eliminates any assumptions made about the call stack of errors.
Functions which definition is too large or complex should be extracted into a own module. Make sure to explicitly name the expression, regardless of whether or not the name is inferred from the containing variable which is often the case in modern browsers or when using compilers such as [Babel][]. This eliminates any assumptions made about the call stack of errors.

> ESLint: [func-style][eslint/func-style]
Expand Down Expand Up @@ -284,7 +284,7 @@ function snow(flake) {

## Parameter Reassign

Never reassign parameters. It can lead to unexpected behavior, especially when accessing the `arguments` object. It can also cause optimization issues, especially in [V8][v8].
Never reassign parameters. It can lead to unexpected behavior, especially when accessing the `arguments` object. It can also cause optimization issues, especially in [V8][].

> ESLint: [no-param-reassign][eslint/no-param-reassign]
Expand Down
2 changes: 1 addition & 1 deletion src/rules/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> This style guide assumes the usage of the JavaScript transpiler [Babel][babel], and requires [babel-preset-env][npm-babel-preset-env] or a equivalent configuration to make use of all ECMAScript 6+ (ES 2015+) features including [staged proposals][tc39-proposals-gh]!
> This style guide assumes the usage of the JavaScript transpiler [Babel][], and requires [babel-preset-env][npm-babel-preset-env] or a equivalent configuration to make use of all ECMAScript 6+ (ES 2015+) features including [staged proposals][tc39-proposals-gh]!
There are two sections with chapters about

Expand Down
2 changes: 1 addition & 1 deletion src/rules/naming_conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default snowFalling;

## Singleton Export

Use [PascalCase][pascalcase] when exporting a constructor, class, singleton, function library or bare object.
Use [PascalCase][] when exporting a constructor, class, singleton, function library or bare object.

###### Examples

Expand Down
2 changes: 1 addition & 1 deletion src/rules/react/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function withSnow(ComposedComponent) {

#### Spreading Explicitly Known Props

Spreading objects with known, explicit props. This can be particularly useful when testing React components with [Mocha][mocha]'s `beforeEach` construct.
Spreading objects with known, explicit props. This can be particularly useful when testing React components with [Mocha][]'s `beforeEach` construct.

```jsx
export default function Snow {
Expand Down
8 changes: 4 additions & 4 deletions src/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

### Recommended libraries and frameworks

- [Jasmine][jasmine]
- [Jest][jest]
- [Mocha][mocha]
- [Sinon.js][sinon.js]
- [Jasmine][]
- [Jest][]
- [Mocha][]
- [Sinon.js][]

###### References

Expand Down

0 comments on commit 90953d7

Please sign in to comment.