Browse Source

lint everything

pull/487/head
Vladimir Volek 3 years ago
parent
commit
6a7576b546
  1. 1
      .eslintignore
  2. 1
      .prettierignore
  3. 28
      babel.config.js
  4. 9
      jest.config.js
  5. 2
      package.json
  6. 6
      server/index.js
  7. 2
      test/integration/dashboard.spec.js
  8. 8
      test/plugins/index.js
  9. 2
      test/scripts/init-device.js
  10. 2
      test/support/index.js

1
.eslintignore

@ -3,6 +3,7 @@ build
coverage
cache/**
node_modules
scripts/solidity/**
src/flowtype/npm
scripts/solidity/.*
**/_old/*

1
.prettierignore

@ -2,6 +2,7 @@ public
build
coverage
cache/**
scripts/solidity/**
node_modules
src/flowtype/npm
scripts/solidity/.*

28
babel.config.js

@ -1,4 +1,4 @@
module.exports = (api) => {
module.exports = api => {
// api.cache.forever();
const presets = [
@ -27,13 +27,9 @@ module.exports = (api) => {
[
'module-resolver',
{
root: [
'./src',
],
root: ['./src'],
alias: {
public: [
'./public',
],
public: ['./public'],
},
},
],
@ -45,19 +41,17 @@ module.exports = (api) => {
}
if (api.env('translations')) {
plugins.push(
[
'react-intl',
{
messagesDir: './translations/extractedMessages/',
extractSourceLocation: true,
},
],
);
plugins.push([
'react-intl',
{
messagesDir: './translations/extractedMessages/',
extractSourceLocation: true,
},
]);
}
return {
presets,
plugins,
};
};
};

9
jest.config.js

@ -11,10 +11,7 @@ module.exports = {
'utils/promiseUtils.js',
'utils/networkUtils.js',
],
collectCoverageFrom: [
'utils/**.js',
'reducers/utils/**.js',
],
collectCoverageFrom: ['utils/**.js', 'reducers/utils/**.js'],
// coverageThreshold: {
// global: {
// branches: 100,
@ -23,9 +20,7 @@ module.exports = {
// statements: 100,
// },
// },
setupFiles: [
'./support/setupJest.js',
],
setupFiles: ['./support/setupJest.js'],
transform: {
'^.+\\.jsx?$': 'babel-jest',
},

2
package.json

@ -19,7 +19,7 @@
"translations:download": "yarn ttm build-translations && sleep 1 && yarn ttm export-translations",
"flow": "flow check src",
"lint": "run-s lint:*",
"lint:js": "npx eslint ./src ./webpack",
"lint:js": "npx eslint .",
"lint:css": "npx stylelint './src/**/*.js'",
"lint-fix": "npx eslint ./src ./webpack --fix",
"test": "run-s test:*",

6
server/index.js

@ -19,7 +19,11 @@ const app = express();
const PORT = process.env.PORT || 8080;
// Setup logger
app.use(morgan(':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] :response-time ms'));
app.use(
morgan(
':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] :response-time ms'
)
);
// Serve static assets
app.use(express.static(path.resolve(__dirname, '..', 'build', commander.buildType)));

2
test/integration/dashboard.spec.js

@ -23,4 +23,4 @@ describe('Dashboard page', () => {
.should('be.visible')
.matchImageSnapshot();
});
});
});

8
test/plugins/index.js

@ -1,7 +1,5 @@
const {
addMatchImageSnapshotPlugin,
} = require('cypress-image-snapshot/plugin');
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
module.exports = (on) => {
module.exports = on => {
addMatchImageSnapshotPlugin(on);
};
};

2
test/scripts/init-device.js

@ -3,4 +3,4 @@ import { initSeedAllDevice } from 'trezor-bridge-communicator';
(async () => {
await initSeedAllDevice();
})();
})();

2
test/support/index.js

@ -3,4 +3,4 @@ import './commands';
beforeEach(() => {
window.localStorage.setItem('/betaModalPrivacy', true);
});
});

Loading…
Cancel
Save