79631392

Date: 2025-05-21 01:55:36
Score: 2.5
Natty:
Report link

Try adjusting the export/import as follows, does that resolve the issue?

// js-grid-helper.js
const TABLE_COLUMNS_DATA = [
    { name: 'column_1',  title: 'Column 1',  type: 'text'}
    ,{ name: 'column_2',    title: 'Column 2', type: 'text'}
    ,{ name: 'column_3', title: 'Column 3', type: 'text'}
];
export default TABLE_COLUMNS_DATA;

// page.js

import TABLE_COLUMNS from "./test"; // note that we have the freedom to use import TABLE_COLUMNS instead of import TABLE_COLUMNS_DATA, because TABLE_COLUMNS_DATA was default export
console.log(TABLE_COLUMNS); // [ { name: 'column_1',  title: 'Column 1',  type: 'text'} ,{ name: 'column_2',    title: 'Column 2', type: 'text'} ,{ name: 'column_3', title: 'Column 3', type: 'text'} ]

$('#my-table').jsGrid({
    /* ... */
    fields: TABLE_COLUMNS,
});

ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export

Reasons:
  • RegEx Blacklisted phrase (1.5): resolve the issue?
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: admcfajn