Skip to content

Commit 3df8a47

Browse files
authored
feat: Sort destructured properties (#1)
* Start adding rules * Build outputs * Auto format code * Changelog * TS config * Babel config * Add jest * Work on sort object patterns * Autofix * Add comment tests * Fix comment sorting * Update rule name * Rename files * Rename spec * Use babel for compilation * Turn off semicolons, they slow down coding when wrapping with parens * Apply formatting changes Co-authored-by: mskelton <[email protected]>
1 parent ad57e84 commit 3df8a47

22 files changed

+8288
-633
lines changed

.babelrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"env": {
3+
"build": {
4+
"ignore": ["*/__tests__/", "*/__fixtures__/"]
5+
}
6+
},
7+
"ignore": ["/node_modules/"],
8+
"presets": [
9+
"@babel/preset-typescript",
10+
[
11+
"@babel/preset-env",
12+
{
13+
"targets": {
14+
"node": true
15+
}
16+
}
17+
]
18+
]
19+
}

.eslintrc

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"plugin:@typescript-eslint/recommended",
1313
"prettier/@typescript-eslint"
1414
],
15-
"files": ["*.ts", "*.tsx"],
1615
"parser": "@typescript-eslint/parser",
1716
"rules": {
1817
"@typescript-eslint/explicit-function-return-type": "off",

.github/workflows/build.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [10.x, 12.x]
8+
node-version: [10.x, 12.x, 14.x]
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: Use Node.js ${{ matrix.node-version }}
@@ -19,6 +19,11 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: "12"
25+
- run: npm ci
26+
- run: npm run build
2227
- uses: cycjimmy/[email protected]
2328
env:
2429
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/format.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Format
2+
on:
3+
pull_request:
4+
branches: [master]
5+
jobs:
6+
format:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
ref: ${{ github.head_ref }}
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: "12.x"
15+
- name: Format
16+
run: |
17+
npm ci
18+
npm run format
19+
- name: Commit changes
20+
uses: stefanzweifel/[email protected]
21+
with:
22+
commit_message: Apply formatting changes
23+
branch: ${{ github.head_ref }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
lib/

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"semi": false
3+
}

CHANGELOG.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Changelog
22

3-
## v1.0.0
4-
5-
Initial release 🎉
3+
The changelog is automatically updated using [semantic-release](https://github.com/semantic-release/semantic-release). You can see it on the [releases page](../../releases).

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
[![Build status](https://github.com/mskelton/eslint-plugin-sort/workflows/Build/badge.svg)](https://github.com/mskelton/eslint-plugin-sort/actions)
44
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors)
5+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
56

67
> Autofixable sort rules for ESLint.
78
89
## Installation
910

10-
1111
```sh
12-
npm install eslint-plugin-sort
12+
npm install -D eslint-plugin-sort
1313
```
1414

15-
1615
## Usage
1716

1817
// TODO
@@ -32,6 +31,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
3231

3332
<!-- markdownlint-enable -->
3433
<!-- prettier-ignore-end -->
34+
3535
<!-- ALL-CONTRIBUTORS-LIST:END -->
3636

3737
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

jest.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
testRegex: "/__tests__/.*\\.spec.[jt]s$",
3+
}

0 commit comments

Comments
 (0)