Browse Source

Cleanup and Update

- Update all dependencies
- Use '@futagoza/*' ESLint configurations
- Remove redundent '@pegjs/eslint-config'
- Add TypeScript support to the bundler
master
Futago-za Ryuu 2 years ago
parent
commit
cf022429bb
  1. 27
      .eslintrc.js
  2. 17
      package.json
  3. 13
      test/.eslintrc.js
  4. 2
      test/package.json
  5. 12
      tools/bundler/package.json
  6. 7
      tools/bundler/target.js
  7. 13
      tools/eslint-config/javascript.js
  8. 81
      tools/eslint-config/overrides/typescript.js
  9. 18
      tools/eslint-config/overrides/vue.js
  10. 16
      tools/eslint-config/package.json
  11. 2
      tools/impact/package.json

27
.eslintrc.js

@ -1,12 +1,29 @@
"use strict";
const ts = require( "eslint-config-pegjs/overrides/typescript" )( __dirname );
const vue = require( "eslint-config-pegjs/overrides/vue" );
module.exports = {
"extends": "pegjs",
"overrides": [ ts, vue ],
"extends": "@futagoza",
"rules": {
"no-duplicate-imports": [ "error", { "includeExports": false } ],
"no-eval": 0,
},
"overrides": [ {
"files": [ "*.spec.js", "*.test.js" ],
"extends": "@futagoza/dev/test",
"rules": {
"func-names": 0,
"no-mixed-operators": 0,
},
} ],
"root": true,
};

17
package.json

@ -22,14 +22,17 @@
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
},
"dependencies": {
"codecov": "3.3.0",
"eslint": "5.16.0",
"mocha": "6.1.3",
"mocha-junit-reporter": "1.22.0",
"@futagoza/eslint-config": "9.3.0",
"@futagoza/eslint-config-dev": "9.3.0",
"@types/node": "6",
"codecov": "3.6.1",
"eslint": "6.4.0",
"mocha": "6.2.0",
"mocha-junit-reporter": "1.23.1",
"mocha-multi-reporters": "1.1.7",
"nyc": "14.0.0",
"rimraf": "2.6.3",
"vuepress": "1.0.0-alpha.47"
"nyc": "14.1.1",
"rimraf": "3.0.0",
"vuepress": "1.1.0"
},
"engines": {
"node": ">= 6"

13
test/.eslintrc.js

@ -1,13 +0,0 @@
"use strict";
module.exports = {
"extends": "futagozaryuu/test",
"rules": {
"func-names": 0,
"no-mixed-operators": 0,
},
};

2
test/package.json

@ -5,6 +5,6 @@
"dependencies": {
"chai": "4.2.0",
"chai-like": "1.1.1",
"sinon": "7.3.2"
"sinon": "7.5.0"
}
}

12
tools/bundler/package.json

@ -6,12 +6,14 @@
"bundle": "bundler.js"
},
"dependencies": {
"@babel/core": "7.4.3",
"@babel/preset-env": "7.4.3",
"babel-loader": "8.0.5",
"@babel/core": "7.6.2",
"@babel/preset-env": "7.6.2",
"babel-loader": "8.0.6",
"dedent": "0.7.0",
"webpack": "4.30.0",
"webpack-cli": "3.3.0"
"ts-loader": "6.1.2",
"typescript": "3.6.3",
"webpack": "4.41.0",
"webpack-cli": "3.3.9"
},
"engines": {
"node": ">= 6"

7
tools/bundler/target.js

@ -49,6 +49,9 @@ function target( { entry, library, output } ) {
performance: {
hints: false,
},
resolve: {
extensions: [ ".ts", ".js" ]
},
module: {
rules: [
{
@ -59,6 +62,10 @@ function target( { entry, library, output } ) {
options: require( "./babel.config.js" ),
},
},
{
test: /\.ts$/,
loader: "ts-loader",
},
],
},
plugins: [

13
tools/eslint-config/javascript.js

@ -1,13 +0,0 @@
"use strict";
module.exports = {
"extends": "futagozaryuu/node-v6",
"rules": {
"no-duplicate-imports": [ "error", { "includeExports": false } ],
"no-eval": 0,
},
};

81
tools/eslint-config/overrides/typescript.js

@ -1,81 +0,0 @@
"use strict";
const path = require( "path" );
const config = {
...require( "eslint-config-futagozaryuu/stylistic-issues" ).rules,
...require( "eslint-config-futagozaryuu/variables" ).rules,
...require( "eslint-config-futagozaryuu/es2015" ).rules,
};
function ts( cwd ) {
const ts = require( "@typescript-eslint/eslint-plugin/dist/configs/base.json" );
ts.files = [ "*.ts" ];
ts.parserOptions = {
"project": path.join( cwd, "tsconfig.json" ),
"sourceType": "module",
};
ts.rules = {
...require( "@typescript-eslint/eslint-plugin/dist/configs/recommended.json" ).rules,
...require( "@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended" ).default.overrides[ 0 ].rules,
"strict": "off",
"node/no-unsupported-features/es-syntax": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/indent": config.indent,
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/member-delimiter-style": [ "error", {
"multiline": {
"delimiter": "semi",
"requireLast": true,
},
"singleline": {
"delimiter": "semi",
"requireLast": true,
},
} ],
"@typescript-eslint/member-naming": [ "warn", {
"private": "^_",
} ],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-array-constructor": config[ "no-array-constructor" ],
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extraneous-class": [ "error", {
"constructorOnly": true,
"allowEmpty": false,
"staticOnly": false,
} ],
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-type-alias": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": config[ "no-use-before-define" ],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": config[ "no-useless-constructor" ],
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/explicit-function-return-type": [ "error", {
allowExpressions: true,
} ],
};
return ts;
}
module.exports = ts;

18
tools/eslint-config/overrides/vue.js

@ -1,18 +0,0 @@
"use strict";
const vue = require( "eslint-plugin-vue/lib/configs/base" );
vue.files = [ "*.vue" ];
Object.assign( vue.rules, {
...require( "eslint-plugin-vue/lib/configs/essential" ).rules,
...require( "eslint-plugin-vue/lib/configs/strongly-recommended" ).rules,
...require( "eslint-plugin-vue/lib/configs/recommended" ).rules,
"vue/html-indent": [ "error", 4 ],
"vue/singleline-html-element-content-newline": 0,
} );
module.exports = vue;

16
tools/eslint-config/package.json

@ -1,16 +0,0 @@
{
"name": "eslint-config-pegjs",
"version": "2.3.0",
"private": true,
"main": "javascript.js",
"dependencies": {
"@typescript-eslint/eslint-plugin": "1.9.1-alpha.26",
"@typescript-eslint/parser": "1.9.1-alpha.26",
"eslint-config-futagozaryuu": "5.8.0",
"eslint-plugin-vue": "5.2.2",
"typescript": "3.5.1"
},
"engines": {
"node": ">= 6"
}
}

2
tools/impact/package.json

@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"dedent": "0.7.0",
"glob": "7.1.3"
"glob": "7.1.4"
}
}
Loading…
Cancel
Save