Skip to content

Commit

Permalink
sort typescript imports with "import-sort" module
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Aug 28, 2018
1 parent 05c6239 commit 82ce622
Show file tree
Hide file tree
Showing 108 changed files with 5,283 additions and 366 deletions.
5 changes: 1 addition & 4 deletions .editorconfig
Expand Up @@ -11,10 +11,7 @@ trim_trailing_whitespace = true
insert_final_newline = true
max_line_length=140

[*.json]
indent_size = 2

[*.yml]
[{*.json,*.yml}]
indent_size = 2

[*.md]
Expand Down
6 changes: 6 additions & 0 deletions .importsortrc.json
@@ -0,0 +1,6 @@
{
".ts": {
"parser": "typescript",
"style": "@email-securely-app/import-sort-style"
}
}
16 changes: 16 additions & 0 deletions .lintstagedrc.json
@@ -0,0 +1,16 @@
{
"linters": {
"*.ts": [
"import-sort --write",
"yarn run lint:ts:base --fix",
"git add"
],
"*.js": [
"yarn run lint:js:base --fix",
"git add"
]
},
"ignore": [
"./packages"
]
}
1 change: 1 addition & 0 deletions .npmignore
@@ -0,0 +1 @@
/*
24 changes: 16 additions & 8 deletions package.json
Expand Up @@ -11,6 +11,7 @@
},
"main": "./app/electron-main.js",
"scripts": {
"precommit": "lint-staged",
"app:dist": "npm-run-all security-check lint test:electron-main test:web clean:app build assets electron-builder:install-app-deps test:e2e",
"build": "npm-run-all build:electron-main build:electron-preload build:web",
"build:dev": "cross-env NODE_ENV=development npm-run-all build",
Expand Down Expand Up @@ -50,9 +51,11 @@
"electron-builder:publish:x64:linux": "electron-builder --publish onTagOrDraft --x64 --linux AppImage deb freebsd pacman rpm snap",
"lint": "npm-run-all lint:sass lint:code",
"lint:code": "npm-run-all lint:js lint:ts",
"lint:js": "tslint \"./src/**/*.js\" \"./*.js\"",
"lint:js:base": "tslint",
"lint:js": "yarn run lint:js:base \"./src/**/*.js\" \"./*.js\"",
"lint:sass": "sass-lint -v -q -c ./sass-lint.yml",
"lint:ts": "tslint -p ./tsconfig.json \"./src/**/*.ts\" \"./scripts/**/*.ts\" \"./src/**/*.js\"",
"lint:ts:base": "tslint -p ./tsconfig.json",
"lint:ts": "yarn run lint:ts:base \"./src/**/*.ts\" \"./scripts/**/*.ts\"",
"security-check": "nsp check --preprocessor yarn --reporter table",
"start": "npm-run-all build:app start:electron-main",
"start:electron": "electron ./app/electron-main.js",
Expand Down Expand Up @@ -81,7 +84,7 @@
"electron-log": "2.2.17",
"electron-rpc-api": "2.0.0",
"electron-unhandled": "1.1.0",
"electron-updater": "3.1.1",
"electron-updater": "3.1.2",
"fs-json-store": "2.0.4",
"fs-json-store-encryption-adapter": "1.2.2",
"fs-no-eperm-anymore": "2.0.2",
Expand Down Expand Up @@ -111,12 +114,12 @@
"@angular/platform-browser-dynamic": "6.1.4",
"@angular/router": "6.1.4",
"@angularclass/hmr": "2.1.3",
"@email-securely-app/import-sort-style": "0.1.0",
"@ng-select/ng-select": "2.5.0",
"@ngrx/effects": "6.1.0",
"@ngrx/router-store": "6.1.0",
"@ngrx/store": "6.1.0",
"@ngtools/webpack": "6.1.4",
"@types/glob": "5.0.35",
"@types/html-webpack-plugin": "3.2.0",
"@types/jasmine": "2.8.8",
"@types/karma": "1.7.5",
Expand All @@ -128,7 +131,7 @@
"@types/ramda": "0.25.36",
"@types/randomstring": "1.1.6",
"@types/semver": "5.5.0",
"@types/sinon": "5.0.1",
"@types/sinon": "5.0.2",
"@types/stacktrace-js": "0.0.32",
"@types/systemjs": "0.20.6",
"@types/tapable": "1.0.4",
Expand All @@ -154,14 +157,16 @@
"cssnano": "4.1.0",
"devtron": "1.4.0",
"electron": "2.0.8",
"electron-builder": "20.28.2",
"electron-builder": "20.28.3",
"exports-loader": "0.7.0",
"file-loader": "2.0.0",
"font-awesome": "4.7.0",
"glob": "7.1.2",
"html-loader": "0.5.5",
"html-webpack-plugin": "4.0.0-alpha",
"husky": "0.14.3",
"immer": "1.3.1",
"import-sort-cli": "5.2.0",
"import-sort-parser-typescript": "5.0.0",
"jasmine": "3.2.0",
"karma": "3.0.0",
"karma-chrome-launcher": "2.2.0",
Expand All @@ -172,13 +177,15 @@
"karma-webpack": "3.0.0",
"keysim": "2.1.0",
"less-loader": "4.1.0",
"lint-staged": "7.2.2",
"mini-css-extract-plugin": "0.4.2",
"mkdirp": "0.5.1",
"ng2-dragula": "2.0.2",
"ngx-bootstrap": "3.0.1",
"node-fetch": "2.2.0",
"node-sass": "4.9.3",
"npm-run-all": "4.1.3",
"npx": "10.2.0",
"nsp": "3.2.1",
"nsp-preprocessor-yarn": "1.1.2",
"null-loader": "0.1.1",
Expand All @@ -201,7 +208,7 @@
"source-map-loader": "0.2.4",
"source-map-support": "0.5.9",
"spectron": "3.8.0",
"style-loader": "0.22.1",
"style-loader": "0.23.0",
"stylus-loader": "3.0.2",
"to-string-loader": "1.1.5",
"ts-deferred": "1.0.4",
Expand All @@ -211,6 +218,7 @@
"tsconfig-paths-webpack-plugin": "3.2.0",
"tslint": "5.11.0",
"tslint-consistent-codestyle": "1.13.3",
"tslint-eslint-rules": "5.4.0",
"tslint-rules-bunch": "0.0.5",
"typescript": "3.0.1",
"uglifyjs-webpack-plugin": "1.3.0",
Expand Down
19 changes: 19 additions & 0 deletions packages/import-sort-style/.editorconfig
@@ -0,0 +1,19 @@
# Editor configuration, see http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length=140

[{*.json,*.yml}]
indent_size = 2

[*.md]
max_line_length = off
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions packages/import-sort-style/.gitignore
@@ -0,0 +1,11 @@
# IDE Idea
.idea
*.iml

# Node.js
node_modules
npm-debug.log
yarn-error.log

/dist/
/output/
6 changes: 6 additions & 0 deletions packages/import-sort-style/.importsortrc.json
@@ -0,0 +1,6 @@
{
".ts": {
"parser": "typescript",
"style": "@email-securely-app/import-sort-style"
}
}
15 changes: 15 additions & 0 deletions packages/import-sort-style/.lintstagedrc.json
@@ -0,0 +1,15 @@
{
"linters": {
"*.ts": [
"import-sort --write"
],
"src/**/*.ts": [
"yarn run lint:src:base --fix",
"git add"
],
"test/**/*.ts": [
"yarn run lint:test:base --fix",
"git add"
]
}
}
6 changes: 6 additions & 0 deletions packages/import-sort-style/.npmignore
@@ -0,0 +1,6 @@
/*

!/dist/
!/LICENSE
!/package.json
!/README.md
18 changes: 18 additions & 0 deletions packages/import-sort-style/.travis.yml
@@ -0,0 +1,18 @@
# https://docs.travis-ci.com/user/customizing-the-build/

if: tag IS blank
os:
- linux
- osx
sudo: false
language: node_js
node_js:
- "8"
- "10"
install:
- yarn install
script:
- node --version
- npm --version
- yarn --version
- yarn run dist
21 changes: 21 additions & 0 deletions packages/import-sort-style/LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Vladimir Yakovlev

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.
1 change: 1 addition & 0 deletions packages/import-sort-style/README.md
@@ -0,0 +1 @@
Custom [import-sort](https://github.com/renke/import-sort) style rule built for use by [email-securely-app](https://github.com/vladimiry/email-securely-app).
13 changes: 13 additions & 0 deletions packages/import-sort-style/appveyor.yml
@@ -0,0 +1,13 @@
environment:
matrix:
- nodejs_version: "8"
- nodejs_version: "10"
install:
- ps: Install-Product node $env:nodejs_version
- yarn install
build: off
test_script:
- node --version
- npm --version
- yarn --version
- yarn run dist
55 changes: 55 additions & 0 deletions packages/import-sort-style/package.json
@@ -0,0 +1,55 @@
{
"name": "@email-securely-app/import-sort-style",
"version": "0.1.0",
"description": "Custom \"import-sort\" style rule built for use by \"email-securely-app\"",
"author": "Vladimir Yakovlev <dev.vladimir.y@gmail.com> (https://github.com/vladimiry)",
"license": "MIT",
"homepage": "https://github.com/vladimiry/email-securely-app",
"repository": "git@github.com:vladimiry/email-securely-app.git",
"keywords": [
"import-sort",
"typescript",
"import-formatter",
"formatter",
"formatting"
],
"main": "./dist/index.js",
"scripts": {
"precommit": "lint-staged",
"src:compile": "tsc --listEmittedFiles -p ./src/tsconfig.json",
"src:compile:watch": "tsc -w -p ./src/tsconfig.json",
"dist:clean": "rimraf ./dist",
"dist": "npm-run-all dist:clean lint src:compile test",
"lint:src:base": "tslint -p ./src/tsconfig.json -c ./tslint.json",
"lint:src": "yarn run lint:src:base \"./src/lib/**/*.ts\"",
"lint:test:base": "tslint -p ./test/tsconfig.json -c ./test/tslint.json",
"lint:test": "yarn run lint:test:base \"./test/**/*.ts\"",
"lint": "npm-run-all lint:src lint:test",
"test": "cross-env TS_NODE_PROJECT=./test/tsconfig.json ava --verbose \"./test/**/*.spec.ts\""
},
"ava": {
"compileEnhancements": false,
"extensions": [
"ts"
],
"require": [
"ts-node/register"
]
},
"devDependencies": {
"@email-securely-app/import-sort-style": "0.1.0",
"@types/node": "^10.5.3",
"ava": "^1.0.0-beta.7",
"cross-env": "^5.2.0",
"husky": "^0.14.3",
"import-sort-parser": "^5.0.0",
"import-sort-style": "^5.0.0",
"lint-staged": "^7.2.2",
"npm-run-all": "^4.1.3",
"rimraf": "^2.6.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"tslint-rules-bunch": "^0.0.5",
"typescript": "^3.0.1"
}
}

0 comments on commit 82ce622

Please sign in to comment.