Skip to content

Commit

Permalink
Fix many tests, add hot-patching to get the ball rolling
Browse files Browse the repository at this point in the history
  • Loading branch information
onigoetz committed Oct 14, 2021
1 parent a47f432 commit 060d4f4
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 97 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@
},
"engines": {
"node": ">=12"
},
"resolutions": {
"**/eslint": "8.0.0-beta.1"
}
}
2 changes: 1 addition & 1 deletion packages/crafty-preset-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"babel-loader": "8.2.2",
"gulp-babel": "8.0.0",
"gulp-concat": "2.6.1",
"gulp-eslint7": "0.3.2",
"gulp-eslint-new": "0.4.0",
"gulp-newer": "1.4.0",
"gulp-sourcemaps": "3.0.0",
"gulp-terser": "2.1.0"
Expand Down
8 changes: 6 additions & 2 deletions packages/crafty-preset-babel/src/gulp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ module.exports = function createTask(crafty, bundle, StreamHandler) {
const {
toTempFile
} = require("@swissquote/crafty-preset-eslint/src/eslintConfigurator");
const eslint = require("gulp-eslint7");
stream.add(eslint(toTempFile(crafty.config.eslint))).add(eslint.format());
const eslint = require("gulp-eslint-new");
stream.add(eslint(
{
overrideConfigFile: toTempFile(crafty.config.eslint)
}
)).add(eslint.format());

// Fail the build if we have linting
// errors and we build directly
Expand Down
2 changes: 1 addition & 1 deletion packages/crafty-preset-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@swissquote/rollup-plugin-eslint": "1.16.3",
"copy-anything": "2.0.3",
"debug": "^4.1.0",
"eslint": "8.0.0-beta.1",
"eslint": "8.0.1",
"eslint-webpack-plugin": "3.0.1",
"merge-anything": "4.0.1",
"resolve-from": "5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/crafty-preset-eslint/src/commands/jsLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ process.argv.push(require.resolve("../resolver.js"))
process.argv.push("--config");
process.argv.push(tmpfile);

require("eslint/bin/eslint");
require(".bin/eslint");
3 changes: 1 addition & 2 deletions packages/crafty-preset-eslint/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ module.exports = {
chain.plugin("lint-js").use(require.resolve("eslint-webpack-plugin"), [
{
extensions: crafty.config.eslintExtensions,
overrideConfigFile: toTempFile(crafty.config.eslint),
resolver: require.resolve("@swissquote/crafty-preset-eslint/src/resolver.js")
overrideConfigFile: toTempFile(crafty.config.eslint)
}
]);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/crafty-preset-eslint/src/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {
} = require("@eslint/eslintrc");

function resolve(moduleName, relativeToPath) {
console.log("resolving", { moduleName, relativeToPath });
//console.log({moduleName, relativeToPath});
try {
// First check for the module relative to the current location
return ModuleResolver.resolve(moduleName, __filename);
Expand Down
2 changes: 1 addition & 1 deletion packages/crafty-preset-swc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"debug": "^4.1.0",
"find-up": "5.0.0",
"gulp-concat": "2.6.1",
"gulp-eslint7": "0.3.2",
"gulp-eslint-new": "0.4.0",
"gulp-newer": "1.4.0",
"gulp-sourcemaps": "3.0.0",
"gulp-swc": "1.1.1",
Expand Down
8 changes: 6 additions & 2 deletions packages/crafty-preset-swc/src/gulp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ module.exports = function createTask(crafty, bundle, StreamHandler) {
const {
toTempFile
} = require("@swissquote/crafty-preset-eslint/src/eslintConfigurator");
const eslint = require("gulp-eslint7");
stream.add(eslint(toTempFile(crafty.config.eslint))).add(eslint.format());
const eslint = require("gulp-eslint-new");
stream.add(eslint(
{
overrideConfigFile: toTempFile(crafty.config.eslint)
}
)).add(eslint.format());

// Fail the build if we have linting
// errors and we build directly
Expand Down
2 changes: 1 addition & 1 deletion packages/crafty-preset-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"find-up": "5.0.0",
"fork-ts-checker-webpack-plugin": "6.3.4",
"gulp-babel": "8.0.0",
"gulp-eslint7": "0.3.2",
"gulp-eslint-new": "0.4.0",
"gulp-sourcemaps": "3.0.0",
"gulp-typescript": "5.0.1",
"tmp": "0.2.1",
Expand Down
8 changes: 6 additions & 2 deletions packages/crafty-preset-typescript/src/gulp.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ module.exports = function createTask(crafty, bundle, StreamHandler) {
const {
toTempFile
} = require("@swissquote/crafty-preset-eslint/src/eslintConfigurator");
const eslint = require("gulp-eslint7");
const eslint = require("gulp-eslint-new");
stream
.add(eslint({ configFile: toTempFile(crafty.config.eslint) }))
.add(eslint(
{
overrideConfigFile: toTempFile(crafty.config.eslint)
}
))
.add(eslint.format());

// Fail the build if we have linting
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-swissquote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"eslint": "^6.0.0 | ^7.0.0 | ^8.0.0"
},
"devDependencies": {
"eslint": "8.0.0-beta.1",
"eslint": "8.0.1",
"jest": "27.2.5"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ exports[`Generates IDE Helper 2`] = `
// This file is generated to improve IDE Integration
// You don't need to commit this file, nor need it to run \`crafty build\`
// Fix module resolution
require(\\"__PATH__/packages/crafty-preset-eslint/src/patchModuleResolver.js\\");
module.exports = {
\\"plugins\\": [
\\"@swissquote/swissquote\\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ exports[`Generates IDE Helper 2`] = `
// This file is generated to improve IDE Integration
// You don't need to commit this file, nor need it to run \`crafty build\`
// Fix module resolution
require(\\"__PATH__/packages/crafty-preset-eslint/src/patchModuleResolver.js\\");
module.exports = {
\\"plugins\\": [
\\"@swissquote/swissquote\\"
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
},
"dependencies": {
"@rollup/pluginutils": "4.1.1",
"eslint": "8.0.0-beta.1"
"eslint": "8.0.1"
}
}
Loading

0 comments on commit 060d4f4

Please sign in to comment.