Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migrate to @arcticicestudio/remark-preset-lint #48

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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