Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kas-elvirov committed Mar 24, 2019
1 parent a780634 commit 63f5b89
Show file tree
Hide file tree
Showing 8 changed files with 4,303 additions and 2,710 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ jspm_packages
# Builds
/dist/
*.zip

# Token
.token
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tslint.configFile": "./tslint.json"
}
6,797 changes: 4,101 additions & 2,696 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,27 @@
},
"homepage": "https://github.com/artem-solovev/gloc#readme",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"copy-webpack-plugin": "^4.5.1",
"@types/chrome": "0.0.81",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"copy-webpack-plugin": "^4.6.0",
"eslint": "^4.19.1",
"eslint-config-google": "^0.9.1",
"file-loader": "^1.1.11",
"grunt": "^1.0.2",
"grunt-cli": "^1.2.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-compress": "^1.4.3",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"url-loader": "^1.0.1",
"webpack": "^2.2.0-rc.0"
"ts-loader": "^5.3.3",
"tslint": "^5.14.0",
"typescript": "^3.3.4000",
"typescript-tslint-plugin": "^0.3.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"url-loader": "^1.1.2",
"webpack": "^4.29.0",
"webpack-cli": "^3.3.0"
}
}
2 changes: 1 addition & 1 deletion src/inject.js → src/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* - LOC - lines of code
*/

let githubToken;
let githubToken: string = null;
const APP_NAME = 'GitHub Gloc';
const APP_CLASSNAME = 'github-gloc';
const TRIES_DEFAULT = 5;
Expand Down
23 changes: 23 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"outDir": "./dist/",
"noImplicitAny": true,
"module": "ES6",
"baseUrl": "types",
"typeRoots": ["types"],
"allowJs": true,
"types": ["chrome"],
"lib": ["es2015.core", "dom", "es6"],
"sourceMap": true,
"plugins": [
{
"name": "typescript-tslint-plugin",
"alwaysShowRuleFailuresAsWarnings": false,
"ignoreDefinitionFiles": true,
"configFile": "./tslint.json",
"suppressWhileTypeErrorsPresent": false,
"mockTypeScriptVersion": false
}
]
}
}
134 changes: 134 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"extends": "tslint:latest",
"rules": {
"no-unnecessary-type-assertion": true,

"array-type": [true, "array"],
"ban": [true, "setInterval", "setTimeout"],
"ban-types": {
"options": [
[
"Object",
"Avoid using the `Object` type. Did you mean `object`?"
],
[
"Function",
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`, or use `ts.AnyFunction`."
],
[
"Boolean",
"Avoid using the `Boolean` type. Did you mean `boolean`?"
],
[
"Number",
"Avoid using the `Number` type. Did you mean `number`?"
],
[
"String",
"Avoid using the `String` type. Did you mean `string`?"
]
]
},
"boolean-trivia": true,
"class-name": true,
"comment-format": [true, "check-space"],
"curly": [true],
"debug-assert": true,
"indent": [true, "tabs", 2],
"interface-name": [true, "never-prefix"],
"interface-over-type-literal": true,
"jsdoc-format": true,
"linebreak-style": [true, "CRLF"],
"next-line": [true, "check-catch", "check-else"],
"no-bom": true,
"no-double-space": true,
"no-eval": true,
"no-in-operator": true,
"no-increment-decrement": true,
"no-inferrable-types": true,
"no-internal-module": true,
"no-null-keyword": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": [true, "ignore-template-strings"],
"no-type-assertion-whitespace": true,
"no-unnecessary-qualifier": true,
"no-var-keyword": true,
"object-literal-shorthand": true,
"object-literal-surrounding-space": true,
"one-line": [true, "check-open-brace", "check-whitespace"],
"prefer-const": true,
"quotemark": [true, "single", "avoid-escape"],
"semicolon": [true, "always", "ignore-bound-class-methods"],
"space-within-parens": true,
"triple-equals": true,
"type-operator-spacing": true,
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type"
],

"no-implicit-dependencies": [true, "dev"],
"object-literal-key-quotes": [true, "consistent-as-needed"],
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore"
],

"arrow-parens": false,
"arrow-return-shorthand": false,
"forin": false,
"member-access": false,
"no-conditional-assignment": false,
"no-console": [true, "log"],
"no-debugger": false,
"no-empty-interface": false,
"no-object-literal-type-assertion": false,
"no-shadowed-variable": false,
"no-submodule-imports": false,
"no-var-requires": false,
"ordered-imports": false,
"prefer-conditional-expression": false,
"radix": false,
"trailing-comma": false,

"align": false,
"eofline": false,
"max-line-length": [true, 120],
"no-consecutive-blank-lines": false,
"space-before-function-paren": false,

"ban-comma-operator": false,
"max-classes-per-file": false,
"member-ordering": false,
"no-angle-bracket-type-assertion": false,
"no-bitwise": false,
"no-namespace": false,
"no-reference": false,
"object-literal-sort-keys": false,
"one-variable-per-declaration": false
}
}
26 changes: 22 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ const webpack = require('webpack');
const path = require( 'path' );
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');

const JSconfig = {
mode: 'production',
name: 'JS',
entry: {
'background': './src/background.js',
'inject': './src/inject.js',
'inject': './src/inject.ts',
'options': './src/options.js',
'popup': './src/popup.js',
},
devtool: 'inline-source-map',
output: {
path: path.resolve( __dirname, 'dist/src/' ),
filename: '[name].js',
Expand All @@ -20,24 +23,39 @@ const JSconfig = {
'node_modules',
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
},
module: {
rules: [
{
use: 'babel-loader',
test: /\.js$/,
},
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/
}
],
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.js$/,
minimize: true,
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: false,
ecma: 6,
mangle: true
},
sourceMap: true
}),
],
};

const HTMLconfig = {
name: 'HTML',
mode: 'production',
entry: {
'index': './index.html',
'options': './options.html',
Expand Down

0 comments on commit 63f5b89

Please sign in to comment.