Skip to content

ci: enable CI tools and linters #220

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

Merged
merged 2 commits into from
Aug 12, 2022
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
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends @1stg/browserslist-config/modern
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "ota-meshi/eslint-plugin-svelte"
}
],
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
4 changes: 4 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"node": "16",
"sandboxes": []
}
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@1stg"
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
/build
/docs-svelte-kit/shim/eslint.mjs
/docs-svelte-kit/shim/assert.mjs
!/.*.js
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ module.exports = {
],
},
overrides: [
{
files: ["*.md"],
extends: "plugin:mdx/recommended",
settings: {
"mdx/code-blocks": true,
},
},
{
files: ["*.mjs"],
parserOptions: {
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/NodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ jobs:
run: yarn install --ignore-engines
- name: Test
run: yarn test
- name: Type Coverage
run: yarn typecov
37 changes: 37 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
commit: "chore: release eslint-plugin-svelte"
title: "chore: release eslint-plugin-svelte"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ dist
/yarn.lock
/lib
/.svelte-kit
/.type-coverage
/build
/svelte.config-dist.js
/docs-svelte-kit/shim/eslint.mjs
Expand Down
7 changes: 7 additions & 0 deletions .remarkrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": [
"@1stg/remark-config",
["lint-final-definition", false],
["lint-no-shortcut-reference-link", false]
]
}
15 changes: 15 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.*ignore
.npmrc
LICENSE
*.png
*.json
*.lock
*.log
*.svg
*.yaml
*.yml
/tests/fixtures/rules
# TODO: enable the following
# should we ignore markdown files?
*.md
/docs-svelte-kit/
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ You can check on the [Online DEMO](https://ota-meshi.github.io/eslint-plugin-sve
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
[![Build Status](https://github.com/ota-meshi/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-svelte/actions?query=workflow%3ACI)

[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ota-meshi/eslint-plugin-svelte.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ota-meshi/eslint-plugin-svelte/context:javascript)
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fota-meshi%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)

## :name_badge: What is this plugin?

[ESLint] plugin for [Svelte].
Expand Down Expand Up @@ -61,7 +67,7 @@ npm install --save-dev eslint eslint-plugin-svelte svelte

### Configuration

Use `.eslintrc.*` file to configure rules. See also: [https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring).
Use `.eslintrc.*` file to configure rules. See also: <https://eslint.org/docs/user-guide/configuring>.

Example **.eslintrc.js**:

Expand Down Expand Up @@ -176,7 +182,7 @@ module.exports = {
}
```

See also [https://github.com/ota-meshi/svelte-eslint-parser#readme](https://github.com/ota-meshi/svelte-eslint-parser#readme).
See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.

#### settings.svelte

Expand Down Expand Up @@ -242,6 +248,7 @@ Example **.vscode/settings.json**:

## :white_check_mark: Rules

<!-- prettier-ignore-start -->
<!--RULES_SECTION_START-->

:wrench: Indicates that the rule is fixable, and using `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the reported problems.
Expand Down Expand Up @@ -330,6 +337,7 @@ These rules relate to this plugin works:

<!--RULES_TABLE_END-->
<!--RULES_SECTION_END-->
<!-- prettier-ignore-end -->

<!--DOCS_IGNORE_START-->

Expand Down
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ You can check on the [Online DEMO](./playground.md).
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
[![Build Status](https://github.com/ota-meshi/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/eslint-plugin-svelte/actions?query=workflow%3ACI)

[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ota-meshi/eslint-plugin-svelte.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ota-meshi/eslint-plugin-svelte/context:javascript)
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fota-meshi%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)

## :name_badge: What is this plugin?

[ESLint] plugin for [Svelte].
Expand All @@ -41,7 +47,9 @@ See [User Guide](./user-guide.md).

## :white_check_mark: Rules

<!-- prettier-ignore-start -->
See [Available Rules](./rules.md).
<!-- prettier-ignore-end -->

## :lock: License

Expand Down
1 change: 1 addition & 0 deletions docs/rules/first-attribute-linebreak.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This rule aims to enforce a consistent location for the first attribute.
<ESLintCodeBlock fix>

<!-- prettier-ignore-start -->

<!--eslint-skip-->

```svelte
Expand Down
19 changes: 14 additions & 5 deletions docs/rules/no-reactive-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ This rule reports whenever a function is defined in a reactive statement. This i
/* eslint svelte/no-reactive-functions: "error" */

/* ✓ GOOD */
const arrowFn = () => { /* ... */ }
const func = function() { /* ... */ }

const arrowFn = () => {
/* ... */
}
const func = function () {
/* ... */
}

/* ✗ BAD */
$: arrowFn = () => { /* ... */ }
$: func = function() { /* ... */ }
$: arrowFn = () => {
/* ... */
}
$: func = function () {
/* ... */
}
</script>
```

Expand All @@ -46,6 +54,7 @@ This rule was taken from [@tivac/eslint-plugin-svelte].
This rule is compatible with `@tivac/svelte/reactive-functions` rule.

[@tivac/eslint-plugin-svelte]: https://github.com/tivac/eslint-plugin-svelte/

## :rocket: Version

This rule was introduced in eslint-plugin-svelte v2.5.0
Expand Down
1 change: 1 addition & 0 deletions docs/rules/prefer-style-directive.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Style directive were added in Svelte v3.46.
<ESLintCodeBlock fix>

<!-- prettier-ignore-start -->

<!--eslint-skip-->

```svelte
Expand Down
1 change: 1 addition & 0 deletions docs/rules/shorthand-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This rule enforces the use of the shorthand syntax in attribute.
<ESLintCodeBlock fix>

<!-- prettier-ignore-start -->

<!--eslint-skip-->

```svelte
Expand Down
1 change: 1 addition & 0 deletions docs/rules/shorthand-directive.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This rule enforces the use of the shorthand syntax in directives.
<ESLintCodeBlock fix>

<!-- prettier-ignore-start -->

<!--eslint-skip-->

```svelte
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/spaced-html-comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ You cannot enforce this style by using [prettier-plugin-svelte]. That is, this r
```

- `"always"` ... There must be at least one whitespace after `<!--` and before `-->`.
- `"never"` ... There should be no leading or trailing whitespace.  There should be no whitespace following.
- `"never"` ... There should be no leading or trailing whitespace. There should be no whitespace following.

## :rocket: Version

Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install --save-dev eslint eslint-plugin-svelte svelte

### Configuration

Use `.eslintrc.*` file to configure rules. See also: [https://eslint.org/docs/user-guide/configuring](https://eslint.org/docs/user-guide/configuring).
Use `.eslintrc.*` file to configure rules. See also: <https://eslint.org/docs/user-guide/configuring>.

Example **.eslintrc.js**:

Expand Down Expand Up @@ -134,7 +134,7 @@ module.exports = {
}
```

See also [https://github.com/ota-meshi/svelte-eslint-parser#readme](https://github.com/ota-meshi/svelte-eslint-parser#readme).
See also <https://github.com/ota-meshi/svelte-eslint-parser#readme>.

#### settings.svelte

Expand Down
3 changes: 3 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"use strict"

module.exports = require("@1stg/lint-staged/tsc")
Loading