Skip to content

Commit

Permalink
Merge pull request #262 from 18F/staging
Browse files Browse the repository at this point in the history
[Security] NPM Audit fixes -- Production
  • Loading branch information
levinmr authored Jul 16, 2024
2 parents 5704b76 + c5966ef commit a4cc913
Show file tree
Hide file tree
Showing 14 changed files with 317 additions and 55 deletions.
34 changes: 34 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { configs: eslintConfigs } = require("@eslint/js");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
const globals = require("globals");
const jsdoc = require("eslint-plugin-jsdoc");

module.exports = [
{
Expand All @@ -13,4 +14,37 @@ module.exports = [
},
eslintConfigs.recommended,
eslintPluginPrettierRecommended,
{
plugins: {
jsdoc,
},
files: ["**/*.js"],
rules: {
...jsdoc.configs.recommended.rules,
"jsdoc/check-indentation": "error",
"jsdoc/check-line-alignment": "error",
"jsdoc/check-syntax": "error",
"jsdoc/convert-to-jsdoc-comments": "warn",
"jsdoc/no-bad-blocks": "error",
"jsdoc/no-blank-block-descriptions": "error",
"jsdoc/no-blank-blocks": "error",
"jsdoc/require-asterisk-prefix": "error",
"jsdoc/require-jsdoc": [
"error",
{
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
},
],
"jsdoc/require-throws": "error",
"jsdoc/sort-tags": "warn",
},
},
];
8 changes: 8 additions & 0 deletions migrations/20170308164751_create_analytics_data.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema.createTable("analytics_data", (table) => {
table.increments("id");
Expand All @@ -9,6 +13,10 @@ exports.up = function (knex) {
});
};

/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.dropTable("analytics_data");
};
8 changes: 8 additions & 0 deletions migrations/20170316115145_add_analytics_data_indexes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema
.table("analytics_data", (table) => {
Expand All @@ -10,6 +14,10 @@ exports.up = function (knex) {
});
};

/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.table("analytics_data", (table) => {
table.dropIndex(["report_name", "report_agency"]);
Expand Down
8 changes: 8 additions & 0 deletions migrations/20170522094056_rename_date_time_to_date.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema
.raw("ALTER TABLE analytics_data RENAME COLUMN date_time TO date")
Expand All @@ -8,6 +12,10 @@ exports.up = function (knex) {
});
};

/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema
.raw("ALTER TABLE analytics_data RENAME COLUMN date TO date_time")
Expand Down
8 changes: 8 additions & 0 deletions migrations/20210706213753_add_date_id_multi_col_index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema.raw(
"CREATE INDEX analytics_data_date_desc_id_asc ON analytics_data (date DESC NULLS LAST, id ASC)",
);
};

/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.table("analytics_data", (table) => {
table.dropIndex("analytics_data_date_desc_id_asc");
Expand Down
8 changes: 8 additions & 0 deletions migrations/20231218165411_create_analytics_data_ga4.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema.createTable("analytics_data_ga4", (table) => {
table.increments("id");
Expand All @@ -10,6 +14,10 @@ exports.up = function (knex) {
});
};

/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.dropTable("analytics_data_ga4");
};
8 changes: 4 additions & 4 deletions migrations/20240130203237_rename_date_time_to_date_ga4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema.raw(
Expand All @@ -9,8 +9,8 @@ exports.up = function (knex) {
};

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.raw(
Expand Down
8 changes: 4 additions & 4 deletions migrations/20240130203849_remove_version_col_ga4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema.table("analytics_data_ga4", (table) => {
Expand All @@ -9,8 +9,8 @@ exports.up = function (knex) {
};

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.table("analytics_data_ga4", (table) => {
Expand Down
8 changes: 8 additions & 0 deletions migrations/20240620192004_add_ga4_data_indexes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.up = function (knex) {
return knex.schema
.table("analytics_data_ga4", (table) => {
Expand All @@ -15,6 +19,10 @@ exports.up = function (knex) {
});
};

/**
* @param {import("knex").Knex} knex the instance of knex
* @returns {Promise<void>} resolves or rejects when the SQL statement completes
*/
exports.down = function (knex) {
return knex.schema.table("analytics_data_ga4", (table) => {
table.dropIndex(["report_name", "report_agency"]);
Expand Down
Loading

0 comments on commit a4cc913

Please sign in to comment.