Skip to content

Commit

Permalink
Move to ESLint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Apr 24, 2024
1 parent e5acfd6 commit 0de2f5d
Show file tree
Hide file tree
Showing 21 changed files with 346 additions and 114 deletions.
12 changes: 12 additions & 0 deletions eslint.config.mjs
@@ -0,0 +1,12 @@
import loguxConfig from '@logux/eslint-config'

export default [
...loguxConfig,
{
files: ['test/**/*.js', 'test/**/*.cjs'],
rules: {
'n/global-require': 'off',
'n/no-missing-require': 'off'
}
}
]
7 changes: 2 additions & 5 deletions package.json
Expand Up @@ -33,7 +33,7 @@
"yaml": "^2.4.1"
},
"devDependencies": {
"@logux/eslint-config": "^52.0.2",
"@logux/eslint-config": "^53.0.1",
"@types/node": "^20.12.7",
"@types/postcss-import": "^14.0.3",
"c8": "^9.1.0",
Expand All @@ -42,7 +42,7 @@
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-n": "^17.2.1",
"eslint-plugin-node-import": "^1.0.4",
"eslint-plugin-perfectionist": "^2.9.0",
"eslint-plugin-prefer-let": "^3.0.1",
Expand All @@ -67,9 +67,6 @@
"optional": true
}
},
"eslintConfig": {
"extends": "@logux/eslint-config"
},
"c8": {
"exclude": [
"test/**/*"
Expand Down
329 changes: 269 additions & 60 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/err/options/parser/.postcssrc.js
@@ -1,4 +1,4 @@
module.exports = function (ctx) {
module.exports = function () {
return {
parser: 'postcss-parser'
}
Expand Down
2 changes: 1 addition & 1 deletion test/err/options/stringifier/.postcssrc.js
@@ -1,4 +1,4 @@
module.exports = function (ctx) {
module.exports = function () {
return {
stringifier: 'postcss-stringifier'
}
Expand Down
2 changes: 1 addition & 1 deletion test/err/options/syntax/.postcssrc.js
@@ -1,4 +1,4 @@
module.exports = function (ctx) {
module.exports = function () {
return {
syntax: 'postcss-syntax'
}
Expand Down
6 changes: 2 additions & 4 deletions test/err/plugins/.postcssrc.js
@@ -1,7 +1,5 @@
module.exports = function (ctx) {
module.exports = function () {
return {
plugins: [
require('./plugin')
]
plugins: [require('./plugin')]
}
}
6 changes: 2 additions & 4 deletions test/err/plugins/array/.postcssrc.js
@@ -1,7 +1,5 @@
module.exports = function (ctx) {
module.exports = function () {
return {
plugins: [
require('postcss-plugin')
]
plugins: [require('postcss-plugin')]
}
}
6 changes: 2 additions & 4 deletions test/err/plugins/array/options/.postcssrc.js
@@ -1,7 +1,5 @@
module.exports = function (ctx) {
module.exports = function () {
return {
plugins: [
require('postcss-plugin')
]
plugins: [require('postcss-plugin')]
}
}
2 changes: 1 addition & 1 deletion test/err/plugins/object/.postcssrc.js
@@ -1,4 +1,4 @@
module.exports = function (ctx) {
module.exports = function () {
return {
plugins: {
'postcss-plugin': {}
Expand Down
2 changes: 1 addition & 1 deletion test/err/plugins/object/options/.postcssrc.js
@@ -1,4 +1,4 @@
module.exports = function (ctx) {
module.exports = function () {
return {
plugins: {
'postcss-plugin': { option: true }
Expand Down
10 changes: 5 additions & 5 deletions test/js/array/cjs/postcss.config.cjs
@@ -1,14 +1,14 @@
module.exports = function (ctx) {
return {
parser: ctx.parser ? 'sugarss' : false,
syntax: ctx.syntax ? 'sugarss' : false,
map: ctx.map ? 'inline' : false,
from: './test/js/array/fixtures/index.css',
to: './test/js/array/expect/index.css',
map: ctx.map ? 'inline' : false,
parser: ctx.parser ? 'sugarss' : false,
plugins: [
require('postcss-import')(),
require('postcss-nested')(),
ctx.env === 'production' ? require('cssnano')() : false
]
],
syntax: ctx.syntax ? 'sugarss' : false,
to: './test/js/array/expect/index.css'
}
}
6 changes: 5 additions & 1 deletion test/js/array/esm-in-js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions test/js/array/esm/postcss.config.mjs
@@ -1,18 +1,18 @@
import cssnano from 'cssnano'
import postcssImport from 'postcss-import'
import postcssNested from 'postcss-nested'
import cssnano from 'cssnano'

export default function (ctx) {
return {
parser: ctx.parser ? 'sugarss' : false,
syntax: ctx.syntax ? 'sugarss' : false,
map: ctx.map ? 'inline' : false,
from: './test/js/array/fixtures/index.css',
to: './test/js/array/expect/index.css',
map: ctx.map ? 'inline' : false,
parser: ctx.parser ? 'sugarss' : false,
plugins: [
postcssImport(),
postcssNested(),
ctx.env === 'production' ? cssnano() : false
]
],
syntax: ctx.syntax ? 'sugarss' : false,
to: './test/js/array/expect/index.css'
}
}
14 changes: 7 additions & 7 deletions test/js/object/cjs/postcss.config.cjs
@@ -1,14 +1,14 @@
module.exports = function (ctx) {
return {
parser: ctx.parser ? 'sugarss' : false,
syntax: ctx.syntax ? 'sugarss' : false,
map: ctx.map ? 'inline' : false,
from: './test/js/object/fixtures/index.css',
to: './test/js/object/expect/index.css',
map: ctx.map ? 'inline' : false,
parser: ctx.parser ? 'sugarss' : false,
plugins: {
cssnano: ctx.env === 'production' ? {} : false,
'postcss-import': {},
'postcss-nested': {},
cssnano: ctx.env === 'production' ? {} : false
}
'postcss-nested': {}
},
syntax: ctx.syntax ? 'sugarss' : false,
to: './test/js/object/expect/index.css'
}
}
6 changes: 5 additions & 1 deletion test/js/object/esm-in-js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions test/js/object/esm/postcss.config.mjs
@@ -1,14 +1,14 @@
export default function (ctx) {
return {
parser: ctx.parser ? 'sugarss' : false,
syntax: ctx.syntax ? 'sugarss' : false,
map: ctx.map ? 'inline' : false,
from: './test/js/object/fixtures/index.css',
to: './test/js/object/expect/index.css',
map: ctx.map ? 'inline' : false,
parser: ctx.parser ? 'sugarss' : false,
plugins: {
cssnano: ctx.env === 'production' ? {} : false,
'postcss-import': {},
'postcss-nested': {},
cssnano: ctx.env === 'production' ? {} : false
}
'postcss-nested': {}
},
syntax: ctx.syntax ? 'sugarss' : false,
to: './test/js/object/expect/index.css'
}
}
6 changes: 5 additions & 1 deletion test/pkg/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/plugins/postcss.config.mjs
@@ -1,9 +1,9 @@
const plugin = {
postcssPlugin: 'test',
get postcss () {
this.called = true
return () => {}
}
},
postcssPlugin: 'test'
}

const mod = {}
Expand Down
6 changes: 5 additions & 1 deletion test/ts/array/esm-in-ts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion test/ts/object/esm-in-ts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0de2f5d

Please sign in to comment.