Skip to content

Commit

Permalink
chore(eslint-config-amex): update 15.x (#45)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drops support for node 10, 12, and 14
  • Loading branch information
JAdshead authored May 26, 2022
1 parent 5897ae4 commit f2d501c
Show file tree
Hide file tree
Showing 8 changed files with 14,542 additions and 25,069 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '10.x', '12.x', '14.x' ]
node: [ '16.x']
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: '16'
- run: NODE_ENV=development npm ci
- run: npm run test
- name: Semantic release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '10.x', '12.x', '14.x' ]
node: ['16.x']
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions __tests__/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('babel-preset-amex', () => {
it('includes an array of presets', () => {
expect(preset().presets).toEqual(expect.any(Array));
expect(preset().presets.length).toBe(2);
preset().presets.forEach(p => expect(p).toEqual(expect.any(Object)));
preset().presets.forEach((p) => expect(p).toEqual(expect.any(Object)));
});

it('includes an array of plugins in production', () => {
Expand All @@ -48,7 +48,7 @@ describe('babel-preset-amex', () => {
it('returns modern preset for env and option', () => {
process.env.NODE_ENV = 'production';
const presetModernOpt = preset({}, { modern: true });
const presetModernEnv = preset({ env: envName => envName === 'modern' });
const presetModernEnv = preset({ env: (envName) => envName === 'modern' });
expect(presetModernOpt).toMatchSnapshot();
expect(presetModernEnv).toMatchSnapshot();
expect(presetModernOpt).toEqual(presetModernEnv);
Expand All @@ -57,7 +57,7 @@ describe('babel-preset-amex', () => {
it('returns server only config when given serverOnly option', () => {
process.env.NODE_ENV = 'production';
const presetServerOnlyOpt = preset({}, { serverOnly: true });
const presetServerEnv = preset({ env: envName => envName === 'server' });
const presetServerEnv = preset({ env: (envName) => envName === 'server' });
expect(presetServerOnlyOpt).toMatchSnapshot();
expect(presetServerEnv).toMatchSnapshot();
expect(presetServerOnlyOpt).toEqual(presetServerEnv);
Expand Down
2 changes: 1 addition & 1 deletion browserlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const browserList = [
'Firefox',
'iOS',
'Safari',
].map(browser => `last 2 ${browser} versions`);
].map((browser) => `last 2 ${browser} versions`);

const legacyBrowserList = ['last 2 versions', 'not dead'];

Expand Down
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ module.exports = (api = {}, opts = {}) => {
targets.browsers = isModern ? browserList : legacyBrowserList;
}

const presetEnvOptions = Object.assign(
{},
{ targets },
opts['preset-env'],
opts.moduleFormat === 'esm' && { modules: false }
);
const presetEnvOptions = {

const reactPresetOptions = Object.assign({}, opts['react-preset']);
targets,
...opts['preset-env'],
...opts.moduleFormat === 'esm' && { modules: false },
};

const reactPresetOptions = { ...opts['react-preset'] };

return {
presets: [
Expand Down
Loading

0 comments on commit f2d501c

Please sign in to comment.