Skip to content

Commit

Permalink
feat: init repot
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisi Linhart authored and Lisi Linhart committed Apr 2, 2024
0 parents commit 2d087f2
Show file tree
Hide file tree
Showing 27 changed files with 11,287 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.eslintrc.json
**/*.md
docs/*.md
dist/
node_modules/
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"@veritem"
],
"rules": {
"indent": [
0,
"tab"
],
"no-case-declarations": 0,
"no-tabs": "off",
"vitest/unbound-method": "off"
}
}
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
open-pull-requests-limit: 2
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run test --if-present
- run: npx conventional-github-releaser -p angular
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
push:
jobs:
test:
runs-on: ubuntu-latest

timeout-minutes: 10

strategy:
matrix:
node-version: [16.x, 18.x]
os: [ubuntu-latest, windows-latest]

fail-fast: false

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 7.16.1

- name: ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: install
run: npm i

- name: test
run: npm run test:ci
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
fixtures/node_modules
.idea/
26 changes: 26 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
line-length: false
link-fragments: false
single-title: false
no-inline-html:
allowed_elements:
- badge
- eslint-code-block
- sup
- rules-table
- span

# enforce consistency
code-block-style:
style: fenced
code-fence-style:
style: backtick
emphasis-style:
style: underscore
heading-style:
style: atx
hr-style:
style: ---
strong-style:
style: asterisk
ul-style:
style: dash
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tests
node_modules
unbouild.config.ts
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/fixtures/
.github/ISSUE_TEMPLATE/*.md
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "none"
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"editor.tabSize": 2,
"eslint.experimental.useFlatConfig": true,
"eslint.validate": ["javascript", "javascriptreact", "vue", "json", "jsonc"],
"typescript.tsdk": "./node_modules/typescript/lib",
"vetur.validation.script": false,
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Lisi Linhart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# eslint-plugin-pinia

![npm](https://img.shields.io/npm/v/eslint-plugin-pinia)
[![ci](https://github.com/lisilinhart/eslint-plugin-pinia/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/lisilinhart/eslint-plugin-pinia/actions/workflows/ci.yml)

Eslint plugin for vitest

## Installation

You'll first need to install [ESLint](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-plugin-pinia`:

```sh
npm install eslint-plugin-pinia --save-dev
```

## Usage

Add `pinia` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
"plugins": ["pinia"]
}
```

Then configure the rules you want to use under the rules section.

```json
{
"rules": {
"pinia/require-export-define-store": [
"warn"
]
}
}
```

### Recommended

To use the recommended configuration, extend it in your `.eslintrc` file:

```json
{
"extends": ["plugin:pinia/recommended"]
}
```

All recommend rules will be set to error by default. You can however disable some rules by setting turning them `off` in your `.eslintrc` file or by setting them to `warn` in your `.eslintrc`.

#### all

To use the all configuration, extend it in your `.eslintrc` file:

```json
{
"extends": ["plugin:pinia/all"]
}
```

## Rules

<!-- begin auto-generated rules list -->

πŸ’Ό Configurations enabled in.\
⚠️ Configurations set to warn in.\
🌐 Set in the `all` configuration.\
βœ… Set in the `recommended` configuration.\
πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

| Name | Description | πŸ’Ό | ⚠️ | πŸ”§ | πŸ’‘ |
| :------------------------------------------------------------------------------------------- | :----------------------------------------------------- | :- | :- | :- | :- |
| [require-setup-store-properties-export](docs/rules/require-setup-store-properties-export.md) | In setup stores all state properties must be exported. | βœ… | 🌐 | πŸ”§ | πŸ’‘ |

<!-- end auto-generated rules list -->

## Credits

- [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) The core repository structure came from this eslint plugin

### Licence

[MIT](https://github.com/lisilinhart/eslint-plugin-pinia/blob/main/LICENSE) Licence &copy; 2024
7 changes: 7 additions & 0 deletions docs/rules/require-setup-store-properties-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# In setup stores all state properties must be exported (`pinia/require-setup-store-properties-export`)

πŸ’Όβš οΈ This rule is enabled in the βœ… `recommended` config. This rule _warns_ in the 🌐 `all` config.

πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).

<!-- end auto-generated rule header -->
Loading

0 comments on commit 2d087f2

Please sign in to comment.