Skip to content

Rewrite to typescript #16

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 28 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4aa3070
Move components to `src` folder, add tsc build
infctr Apr 24, 2020
aa6b16a
Migrate to typescript with loose strict checks
infctr May 2, 2020
1f95122
Update toolchain to run tests
infctr May 2, 2020
22abb3d
Add fixture wrapper for rulesdir/autofix test
infctr May 2, 2020
787c5db
Change comments to jsdoc commments
infctr May 3, 2020
e7cd030
Update tests to typescript
infctr May 4, 2020
a0de41c
Update fixtures
infctr May 4, 2020
f53560d
Update eslint config and tsconfig
infctr May 4, 2020
3e00252
Add stronger types for plugin utils
infctr May 6, 2020
a81e1f9
Add stricter types
infctr May 12, 2020
dd93389
Update dependecies
infctr May 12, 2020
9adef4a
Typescript strict true
infctr May 13, 2020
2e2ccdc
Bump typescript
infctr May 13, 2020
cc9305b
Remove compiling plugin for tests flow
infctr May 13, 2020
aa27543
Remove paths not taken from utils
infctr May 13, 2020
a2b1231
Add url to package.json
infctr May 19, 2020
de58a40
Merge remote-tracking branch 'origin/master' into ts
infctr May 19, 2020
e8dba71
Support `requiredFirst` sorting option
infctr May 20, 2020
123113e
Bump dependencies
infctr May 21, 2020
52a204f
Merge branch 'master' of github.com:infctr/eslint-plugin-typescript-s…
infctr May 21, 2020
e8bcac5
Update tests setup
infctr May 21, 2020
4b61b4e
Add rollup bundler
infctr May 21, 2020
5229f29
Update github actions
infctr May 21, 2020
ae070b8
Update changelog
infctr May 21, 2020
b15daed
Update readme
infctr May 21, 2020
3e243ed
Update scripts tasks
infctr May 22, 2020
8a96d5b
Prettier no-semi
infctr May 22, 2020
066fa23
Update changelog
infctr May 22, 2020
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
tests/fixtures/**
dist
lib
build
53 changes: 46 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,61 @@
module.exports = {
parserOptions: {
sourceType: 'module',
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'eslint-plugin', 'import', 'jest', 'prettier'],
env: {
es6: true,
node: true,
},
extends: [
'airbnb-base',
'prettier/standard',
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:eslint-plugin/all',
'plugin:prettier/recommended',
'plugin:node/recommended',
'prettier/@typescript-eslint',
],
parserOptions: {
ecmaVersion: 10,
project: ['./tsconfig.json', './tests/tsconfig.json'],
sourceType: 'module',
},
rules: {
'object-shorthand': 0,
'no-console': 'warn',

'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
overrides: [
{
files: ['tests/**'],
env: {
jest: true,
},
rules: {
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-alias-methods': 'error',
'jest/no-identical-title': 'error',
'jest/no-jasmine-globals': 'error',
'jest/no-jest-import': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-test-callback': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/prefer-spy-on': 'error',
'jest/valid-expect': 'error',
},
},
],
};
settings: {
'import/resolver': {
node: {
moduleDirectory: ['node_modules', 'src'],
},
},
},
}
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn compile
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
23 changes: 11 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ name: Tests

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn test
env:
CI: true
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn verify
env:
CI: true
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ typings/

# DynamoDB Local files
.dynamodb/

# IDE
.vscode

# Build artifacts
dist
build
lib
5 changes: 5 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged',
},
}
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
tests/fixtures/**
build
dist
lib
4 changes: 3 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
printWidth: 90,
trailingComma: 'all',
arrowParens: 'avoid',
};
semi: false,
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2020-05-22

### Changed

- Rewrite to typescript with strong types
- Leverage helpers and types from @typescript-eslint/experimental-utils
- Run autofix tests with ESLint Class rather than spawn a child process for eslint runner
- Heavy refactoring and remove code paths that were never taken
- Update ESLint config
- Update to ESLint v7.0.0
- Update dependencies

### Added

- Follow semver
- Rollup bundler

## [0.10.0] - 2020-05-21

### Added
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ Then configure the rules you want to use under the rules section.
}
```

Or enable all rules with defaults

```json
{
"extends": ["plugin:typescript-sort-keys/recommended"]
}
```

## Supported Rules

<!-- begin rule list -->
Expand Down
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
}
Loading