prettier-plugin-solidity 1.0.0-rc.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.c8rc ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "check-coverage": true,
3
+ "branches": 99,
4
+ "lines": 100,
5
+ "functions": 100,
6
+ "statements": 100,
7
+ "exclude": ["/node_modules/", "/scripts/", "/src/prettier-comments/"],
8
+ "include": ["src/**/*.js", "!src/prettier-comments/**/*.js"],
9
+ "reporter": ["lcov", "text"],
10
+ "temp-dir": "./coverage/"
11
+ }
package/README.md CHANGED
@@ -77,9 +77,9 @@ Note the use of the [overrides property](https://prettier.io/docs/en/configurati
77
77
 
78
78
  Most options are described in Prettier's [documentation](https://prettier.io/docs/en/options.html).
79
79
 
80
- ### Compiler (experimental)
80
+ ### Compiler
81
81
 
82
- Many versions of the Solidity compiler have changes that affect how the code should be formatted. This plugin, by default, tries to format the code in the most compatible way that it's possible, but you can use the experimental `compiler` option to nudge it in the right direction.
82
+ Many versions of the Solidity compiler have changes that affect how the code should be formatted. This plugin, by default, tries to format the code in the most compatible way that it's possible, but you can use the `compiler` option to nudge it in the right direction.
83
83
 
84
84
  One example of this is import directives. Before `0.7.4`, the compiler didn't accept multi-line import statements, so we always format them in a single line. But if you use the `compiler` option to indicate that you are using a version greater or equal than `0.7.4`, the plugin will use multi-line imports when it makes sense.
85
85
 
package/jest.config.js CHANGED
@@ -1,37 +1,22 @@
1
- const FULL_TEST = Boolean(process.env.FULL_TEST);
2
1
  const TEST_STANDALONE = Boolean(process.env.TEST_STANDALONE);
3
2
 
4
3
  module.exports = {
5
- collectCoverage: FULL_TEST,
6
- collectCoverageFrom: [
7
- 'scripts/**/*.js',
8
- '!scripts/generateIndexes.js',
9
- 'src/**/*.js',
10
- '!<rootDir>/node_modules/',
11
- '!src/prettier-comments/**/*.js'
12
- ],
13
- coverageDirectory: './coverage/',
14
- coveragePathIgnorePatterns: ['/node_modules/', '/scripts/'],
15
- coverageThreshold: {
16
- global: {
17
- branches: 100,
18
- functions: 100,
19
- lines: 100,
20
- statements: 100
21
- }
22
- },
23
4
  moduleNameMapper: {
24
5
  '^prettier$': TEST_STANDALONE
25
6
  ? '<rootDir>/node_modules/prettier/standalone'
26
7
  : '<rootDir>/node_modules/prettier'
27
8
  },
9
+ runner: 'jest-light-runner',
28
10
  setupFiles: ['<rootDir>/tests/config/setup.js'],
29
11
  snapshotSerializers: [
30
12
  'jest-snapshot-serializer-raw',
31
13
  'jest-snapshot-serializer-ansi'
32
14
  ],
33
15
  testEnvironment: 'node',
34
- testRegex: 'jsfmt\\.spec\\.js$|tests/unit/.*\\.js$',
16
+ testMatch: [
17
+ '<rootDir>/tests/format/**/jsfmt.spec.js',
18
+ '<rootDir>/tests/unit/**/*.js'
19
+ ],
35
20
  transform: {},
36
21
  watchPlugins: [
37
22
  'jest-watch-typeahead/filename',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier-plugin-solidity",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0",
4
4
  "description": "A Prettier Plugin for automatically formatting your Solidity code.",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  "lint:fix": "npm run eslint -- --fix && npm run prettier -- --write",
11
11
  "prettier": "prettier './*.{js,json,md,yml}' '{scripts,src,tests}/**/*.js'",
12
12
  "test": "jest",
13
- "test:all": "cross-env FULL_TEST=1 jest"
13
+ "test:all": "cross-env FULL_TEST=1 c8 jest"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -66,27 +66,29 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@babel/code-frame": "^7.18.6",
69
+ "c8": "^7.12.0",
69
70
  "cross-env": "^7.0.3",
70
71
  "dir-to-object": "^2.0.0",
71
- "eslint": "^8.21.0",
72
+ "eslint": "^8.27.0",
72
73
  "eslint-config-airbnb-base": "^15.0.0",
73
74
  "eslint-config-prettier": "^8.5.0",
74
75
  "eslint-plugin-import": "^2.26.0",
75
- "jest": "^29.0.1",
76
+ "jest": "^29.3.1",
77
+ "jest-light-runner": "^0.4.1",
76
78
  "jest-mock-now": "^1.3.0",
77
79
  "jest-snapshot-serializer-ansi": "^1.0.0",
78
80
  "jest-snapshot-serializer-raw": "^1.2.0",
79
- "jest-watch-typeahead": "^2.0.0",
81
+ "jest-watch-typeahead": "^2.2.0",
80
82
  "lines-and-columns": "^2.0.3",
81
- "outdent": "^0.8.0",
82
83
  "prettier": "^2.7.1",
84
+ "proxyquire": "^2.1.3",
83
85
  "solc": "^0.8.17"
84
86
  },
85
87
  "dependencies": {
86
88
  "@solidity-parser/parser": "^0.14.5",
87
- "emoji-regex": "^10.1.0",
89
+ "emoji-regex": "^10.2.1",
88
90
  "escape-string-regexp": "^4.0.0",
89
- "semver": "^7.3.7",
91
+ "semver": "^7.3.8",
90
92
  "solidity-comments-extractor": "^0.0.7",
91
93
  "string-width": "^4.2.3"
92
94
  },