mirror of
https://github.com/pure-css/pure.git
synced 2024-11-07 21:34:24 +00:00
chore: upgrade to eslint@v9 (#1341)
This commit is contained in:
parent
1415a4b0d6
commit
18831f0ad6
@ -1,9 +0,0 @@
|
||||
/build/
|
||||
/node_modules/
|
||||
/release/
|
||||
|
||||
# site files
|
||||
/site/.docusaurus
|
||||
/site/build
|
||||
/site/node_modules
|
||||
/site/static/css/pure
|
50
.eslintrc.js
50
.eslintrc.js
@ -1,50 +0,0 @@
|
||||
module.exports = {
|
||||
'env': {
|
||||
'browser': true,
|
||||
'es6': true,
|
||||
'node': true
|
||||
},
|
||||
'extends': [
|
||||
'eslint:recommended',
|
||||
'plugin:react/recommended'
|
||||
],
|
||||
'globals': {
|
||||
'Atomics': 'readonly',
|
||||
'SharedArrayBuffer': 'readonly'
|
||||
},
|
||||
'parserOptions': {
|
||||
'ecmaFeatures': {
|
||||
'jsx': true
|
||||
},
|
||||
'ecmaVersion': 11,
|
||||
'sourceType': 'module'
|
||||
},
|
||||
'plugins': [
|
||||
'react'
|
||||
],
|
||||
'rules': {
|
||||
'indent': [
|
||||
'error',
|
||||
4
|
||||
],
|
||||
'linebreak-style': [
|
||||
'error',
|
||||
'unix'
|
||||
],
|
||||
'quotes': [
|
||||
'error',
|
||||
'single'
|
||||
],
|
||||
'react/no-unescaped-entities': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'semi': [
|
||||
'error',
|
||||
'always'
|
||||
]
|
||||
},
|
||||
'settings': {
|
||||
'react': {
|
||||
'version': 'detect'
|
||||
}
|
||||
}
|
||||
};
|
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 20.x
|
||||
- uses: webfactory/ssh-agent@v0.5.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
|
||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 20.x
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm test
|
||||
|
57
eslint.config.mjs
Normal file
57
eslint.config.mjs
Normal file
@ -0,0 +1,57 @@
|
||||
import js from '@eslint/js';
|
||||
import globals from 'globals';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
|
||||
export default [
|
||||
js.configs.recommended,
|
||||
reactPlugin.configs.flat.recommended,
|
||||
{
|
||||
ignores: [
|
||||
'.idea/',
|
||||
'*-debug.log',
|
||||
'build/',
|
||||
'node_modules/',
|
||||
'release/',
|
||||
'npm-*.log',
|
||||
'site/.docusaurus',
|
||||
'site/build',
|
||||
'site/node_modules',
|
||||
'site/static/css/pure',
|
||||
],
|
||||
},
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
|
||||
languageOptions: {
|
||||
...reactPlugin.configs.flat.recommended.languageOptions,
|
||||
ecmaVersion: 2024,
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.jest,
|
||||
...globals.mocha,
|
||||
...globals.node,
|
||||
...globals.protractor,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
},
|
||||
rules: {
|
||||
indent: [2, 4, { SwitchCase: 1 }],
|
||||
quotes: [0, 'single'],
|
||||
'no-console': 0,
|
||||
'react/no-unescaped-entities': 0,
|
||||
'react/prop-types': 0,
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
2
index.js
2
index.js
@ -8,7 +8,7 @@ module.exports = {
|
||||
try {
|
||||
cache[name] = fs.readFileSync(this.getFilePath(name), 'utf-8');
|
||||
} catch(e) {
|
||||
throw new Error(name + ' does not exist');
|
||||
throw new Error(name + ' does not exist', e);
|
||||
}
|
||||
}
|
||||
return cache[name];
|
||||
|
897
package-lock.json
generated
897
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
||||
"url": "git://github.com/pure-css/pure.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext .js",
|
||||
"lint": "eslint . --fix",
|
||||
"prepare": "grunt release",
|
||||
"start": "cd site && npm install && npm run start",
|
||||
"test": "grunt test && tap test/*.js --no-coverage"
|
||||
@ -17,8 +17,9 @@
|
||||
"devDependencies": {
|
||||
"@lodder/grunt-postcss": "^3.1.1",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-plugin-react": "^7.31.10",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-plugin-react": "^7.37.1",
|
||||
"globals": "^15.10.0",
|
||||
"grunt": "^1.3.0",
|
||||
"grunt-cli": "^1.2.0",
|
||||
"grunt-contrib-clean": "^2.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user